Skip to content

fix(agent): chunk coalescing fix#1417

Merged
tatoalo merged 1 commit intomainfrom
feat/agent/agent-output-json-truncated
Apr 1, 2026
Merged

fix(agent): chunk coalescing fix#1417
tatoalo merged 1 commit intomainfrom
feat/agent/agent-output-json-truncated

Conversation

@tatoalo
Copy link
Copy Markdown
Contributor

@tatoalo tatoalo commented Apr 1, 2026

Problem

When the agent streams a response, text arrives as agent_message_chunk events buffered and coalesced into a single agent_message. The 500ms flush debounce timer could fire mid-stream, which can let us have partial chunks into a premature agent_message.

Observed in truncated agent output in https://us.posthog.com/project/2/tasks/83e7bc2c-f543-40a7-8100-f0ac99102e4d?runId=44583200-aa9e-496b-b041-f92788d80bd3 (🧵 thread)

@tatoalo tatoalo self-assigned this Apr 1, 2026
@tatoalo tatoalo enabled auto-merge (squash) April 1, 2026 10:57
@tatoalo tatoalo requested review from a team and sortafreel April 1, 2026 10:57
@tatoalo tatoalo merged commit bab78ec into main Apr 1, 2026
15 checks passed
@tatoalo tatoalo deleted the feat/agent/agent-output-json-truncated branch April 1, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants