fix(ag-ui): accumulate streamed TOOL_CALL_ARGS deltas#653
Merged
Conversation
A live model streams tool-call args as many partial-JSON fragments; the
reducer parsed each delta in isolation (only ever valid when the whole payload
arrives in one chunk, e.g. aimock fixtures), so args silently stayed {} and
tool views rendered empty — stuck in their loading state. Found by a live-LLM
local smoke of the client-tools weather card. Accumulate the raw text per
toolCallId, parse the accumulated buffer, keep last-good args, finalize on
TOOL_CALL_END. Regression tests cover fragmented, single-chunk, and
interleaved streams.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Salvaged from #651 (superseded by #652, which landed the fix without a test): the generator must never include ag-ui capabilities — they are Railway- deployed and ship no langgraph.json; including them crashed every LangGraph deploy for days. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found by a live-LLM local smoke of the client-tools weather card (the card sat in its loading state with zero props): the AG-UI reducer parsed each
TOOL_CALL_ARGSdelta in isolation and replacedargswith the result. A live model streams args as many partial-JSON fragments ({"loca,tion":"Pa, …) that never parse alone, soargssilently stayed{}. aimock fixtures ship args in one valid-JSON chunk, which is why every fixture-replay e2e passed — this class of bug is invisible to replay testing.Fix: accumulate the raw delta text per
toolCallId(ReducerStore.argsBuffers), parse the accumulated buffer, keep last-good args while mid-fragment, finalize + drop the buffer onTOOL_CALL_END.Verified:
Also carries the deploy-generator regression test salvaged from #651 (superseded by #652, which landed the fix without a test): the shared LangGraph config generator must exclude ag-ui capabilities.
Process note: adding a live-LLM local smoke step before production smoke — fixture e2e can't catch streaming-shape bugs.
🤖 Generated with Claude Code