Skip to content

fix(streaming): fire InputJsonEvent for server_tool_use blocks - #1875

Open
vjaudir8123-debug wants to merge 1 commit into
anthropics:mainfrom
vjaudir8123-debug:fix/streaming-server-tool-input-json
Open

fix(streaming): fire InputJsonEvent for server_tool_use blocks#1875
vjaudir8123-debug wants to merge 1 commit into
anthropics:mainfrom
vjaudir8123-debug:fix/streaming-server-tool-input-json

Conversation

@vjaudir8123-debug

Copy link
Copy Markdown
Contributor

Summary

When streaming a response that includes a server_tool_use block (e.g. computer use / bash tools), the build_events function was failing to yield InputJsonEvents (and BetaInputJsonEvents) because it only checked content_block.type == "tool_use".

This meant users trying to stream the arguments of a server tool use would silently receive nothing, even though the JSON was being correctly accumulated in the background into the snapshot.

This PR adds "server_tool_use" to the check, allowing InputJsonEvent to fire correctly for server tools in both stable and beta streaming.

@vjaudir8123-debug
vjaudir8123-debug requested a review from a team as a code owner August 23, 2026 03:55
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.

1 participant