Skip to content

fix: honor tool name overrides in StaticStreamWorkbench.call_tool_stream#7884

Open
Osamaali313 wants to merge 1 commit into
microsoft:mainfrom
Osamaali313:fix/stream-workbench-tool-overrides
Open

fix: honor tool name overrides in StaticStreamWorkbench.call_tool_stream#7884
Osamaali313 wants to merge 1 commit into
microsoft:mainfrom
Osamaali313:fix/stream-workbench-tool-overrides

Conversation

@Osamaali313

Copy link
Copy Markdown

Why

StaticWorkbench.call_tool resolves an override name back to its 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 through the streaming API returned is_error=True with "Tool <name> not found";
  • and on success its ToolResult reported the original tool.name instead of the override the caller used.

This makes call_tool_stream inconsistent with call_tool for any workbench configured with tool_overrides.

What

  • Resolve the override name via _override_name_to_original before looking up the tool (mirrors call_tool).
  • Emit the requested name in the yielded ToolResult (both the success and error paths), matching call_tool.

Test

Adds test_static_stream_workbench_call_tool_stream_honors_override: a FunctionTool named double exposed as multiply_by_two, called via call_tool_stream, asserting the final ToolResult has is_error is False and name == "multiply_by_two".

$ pytest tests/test_static_workbench_overrides.py tests/test_workbench.py -q
11 passed

Without the fix the new test fails with is_error=True / "Tool multiply_by_two not found.".

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.
Copilot AI review requested due to automatic review settings June 24, 2026 20:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Osamaali313

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

2 participants