fix(xai): emit tool-result for provider-executed tools in stream#13230
Open
MaxwellCalkin wants to merge 1 commit intovercel:mainfrom
Open
fix(xai): emit tool-result for provider-executed tools in stream#13230MaxwellCalkin wants to merge 1 commit intovercel:mainfrom
MaxwellCalkin wants to merge 1 commit intovercel:mainfrom
Conversation
Provider-executed tools (web_search, x_search, code_execution, mcp, etc.) never emitted tool-result in the stream, causing UIs to stay stuck on "input-available" state. Only file_search_call correctly emitted tool-result on response.output_item.done. This adds tool-result emission for all provider-executed tool types (web_search_call, x_search_call, code_interpreter_call, code_execution_call, view_image_call, view_x_video_call, custom_tool_call, mcp_call) in both the streaming (doStream) and non-streaming (doGenerate) paths. Fixes vercel#13218 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Fixes #13218
Provider-executed tools (
web_search_call,x_search_call,code_execution_call,code_interpreter_call,view_image_call,view_x_video_call,custom_tool_call,mcp_call) never emittedtool-resultin the xAI Responses API adapter, causing UIs to stay stuck on "input-available" / "in progress" state. Onlyfile_search_callcorrectly emittedtool-resultonresponse.output_item.done.Changes
doStream): Addedtool-resultemission onresponse.output_item.donefor all provider-executed tool types, matching howfile_search_callalready worksdoGenerate): Addedtool-resultemission aftertool-callfor all provider-executed tool types, matching howfile_search_callalready worksoutput,error, andserver_labelfieldsstatusandactionfieldstool-resultentries alongsidetool-callentriesweb_search_callandmcp_calltool-result emissionTest plan
pnpm test:node)tool-resultentriesweb_search_callemitstool-resultonoutput_item.donemcp_callemitstool-resultonoutput_item.donetool-resultnot emitted onoutput_item.added(only ondone)Generated with Claude Code