fix: honor tool name overrides in StaticStreamWorkbench.call_tool_stream#7884
Open
Osamaali313 wants to merge 1 commit into
Open
fix: honor tool name overrides in StaticStreamWorkbench.call_tool_stream#7884Osamaali313 wants to merge 1 commit into
Osamaali313 wants to merge 1 commit into
Conversation
StaticWorkbench.call_tool maps an override name back to the original tool before lookup and returns the requested (override) name in the ToolResult. StaticStreamWorkbench.call_tool_stream did neither: it looked tools up by the raw name, so calling a renamed tool via the streaming API returned is_error=True "Tool <name> not found", and its result used the original tool name instead of the override. Resolve the override name before lookup and emit the requested name in the yielded ToolResult, matching call_tool. Adds a regression test.
Author
|
@microsoft-github-policy-service agree |
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.
Why
StaticWorkbench.call_toolresolves an override name back to its original tool before lookup, and returns the requested (override) name in theToolResult.StaticStreamWorkbench.call_tool_streamdid neither:name, so calling a renamed tool through the streaming API returnedis_error=Truewith"Tool <name> not found";ToolResultreported the originaltool.nameinstead of the override the caller used.This makes
call_tool_streaminconsistent withcall_toolfor any workbench configured withtool_overrides.What
_override_name_to_originalbefore looking up the tool (mirrorscall_tool).namein the yieldedToolResult(both the success and error paths), matchingcall_tool.Test
Adds
test_static_stream_workbench_call_tool_stream_honors_override: aFunctionToolnameddoubleexposed asmultiply_by_two, called viacall_tool_stream, asserting the finalToolResulthasis_error is Falseandname == "multiply_by_two".Without the fix the new test fails with
is_error=True/"Tool multiply_by_two not found.".