Skip to content

fix: route onInputAvailable to the repaired tool in streaming calls - #21104

Open
ai-sdk-factory[bot] wants to merge 3 commits into
mainfrom
bugfix-21100-20260918090349776685
Open

ai-sdk-factory[bot] wants to merge 3 commits into
mainfrom
bugfix-21100-20260918090349776685

Conversation

@ai-sdk-factory

Copy link
Copy Markdown
Contributor

Background

Streaming APIs routed repaired tool input to the original tool's onInputAvailable callback, or skipped the callback when the original tool was unknown.

Root Cause

invokeToolCallbacksFromStream selected onInputAvailable using the tool name cached from tool-input-start instead of the parsed tool-call's repaired name; the reproduction confirmed execution used the repaired tool while callback routing did not.

Summary

Completed streamed tool calls now resolve onInputAvailable using the final parsed tool name. Added a patch changeset and removed reproduction-only artifacts.

Testing

Added regression coverage verifying start and delta callbacks remain associated with the streaming name while onInputAvailable uses the completed repaired tool name.

End-to-end Validation

  • pnpm -C packages/ai build followed by the immutable original reproduction command — all generateText, streamText, and ToolLoopAgent.stream routing and control scenarios passed without the bug signal.

Related Issues

Fixes #21100

Closes #21101

ai-sdk-factory and others added 3 commits September 18, 2026 09:09
Co-authored-by: brennanbutler01 <64561607+brennanbutler01@users.noreply.github.com>
Co-authored-by: brennanbutler01 <64561607+brennanbutler01@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

streamText calls the wrong onInputAvailable after tool-name repair

1 participant