Conversation
Parse tool-input-start and tool-input-delta from the AI SDK fullStream to show shimmer actions immediately when the model starts a tool call, then refine with the specific file path or command as soon as it appears in the streamed JSON arguments—before the full content is generated. Also forward toolCallId and bash stdout/stderr/exitCode in tool-result SSE events for richer client-side handling.
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.
Summary
tool-input-startandtool-input-deltaevents from the AI SDKfullStreamto show shimmer actions immediately when the model begins generating a tool callwriteFile/readFile), command (bash), or query (web_search) from the streamed JSON arguments as soon as it appears — well before the full content is generatedtoolCallIdand bashstdout/stderr/exitCodeintool-resultSSE events for richer client-side handlingBefore: The shimmer action (e.g. "Writing components/Chart.tsx") only appeared after the model finished generating the entire tool call arguments (including the full file content), then flashed briefly for ~700ms before clearing.
After: The shimmer appears as soon as the model starts a tool call with a generic label, then refines to the specific file path or command within milliseconds as the first few characters of the JSON arguments stream in. The action is visible for the entire duration of argument generation + tool execution.
Test plan
tsc --noEmit)npm test)writeFile— verify shimmer shows specific path early, not just after code is writtenbash— verify shimmer shows specific command early