Skip to content

Agent bridge: web search and code execution items from Google and Mistral no longer reach Responses clients with an empty item id - #5375

Merged
dragonstyle merged 3 commits into
UKGovernmentBEIS:mainfrom
jayzuccarelli:fix/issue-5373
Sep 16, 2026
Merged

dragonstyle merged 3 commits into
UKGovernmentBEIS:mainfrom
jayzuccarelli:fix/issue-5373

Conversation

@jayzuccarelli

Copy link
Copy Markdown
Contributor

This PR contains:

  • New features
  • Changes to dev-tools e.g. CI config / github tooling
  • Docs
  • Bug fixes
  • Code refactor

What is the current behavior? (You can also link to an open issue here)

Fixes #5373

responses_output_items_from_assistant_message copies ContentToolUse.id straight into web_search_call and code_interpreter_call output items. Google code execution content has id="" and mistral uses id or "", so a scaffold driving those models through the bridge over the Responses API gets items with id: "", and two of them in one turn can't be told apart by id.

What is the new behavior?

When the content id is empty the bridge mints one with uuid(), the same way the other output items in that function already get theirs. Non-empty ids pass through unchanged. The fix is in the bridge only; the providers and the tool_use_to_code_interpreter_param helper are untouched.

Added tests/agent/test_bridge_responses_output_items.py (two web search + two code execution items with id="", asserts non-empty unique ids). It fails on main and passes with the fix. Note #5284 also creates this file, so whichever lands second will need a trivial rebase; happy to do that.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

No.

Other information:

Written with Claude Code (Claude Opus 5).

  • pytest tests/agent: 1554 passed, 1246 skipped, 0 failed; 84 errors, all tests writing to a read-only /tmp in my local sandbox, unrelated to this change
  • ruff check / ruff format --check (0.9.6), mypy on the touched files, make suppressions-check: clean

Slow tests

  • Ran none. The change is a pure sync conversion function covered by the unit test above; I have no Google/Mistral keys or Docker set up to run the gated bridge tests.

Agent review

  • Reviewer: Claude Opus 5 subagent (fresh context), 1 pass
  • Checked the inbound echo path (ensure_id keeps a supplied id), google/mistral/OpenAI replay (none key on this id), and other callers of tool_use_to_code_interpreter_param (none)
  • Findings: 0 correctness; 1 cosmetic dismissed (minted ids have no ws_ prefix, matching the other uuid() items in the same function)

@dragonstyle dragonstyle self-assigned this Sep 14, 2026

@dragonstyle dragonstyle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verified empty and supplied IDs, web-search round-tripping, and streaming item-ID consistency on asyncio and Trio. The empty-ID regression fails without the fix. Approving.

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.

Agent bridge: web_search_call / code_interpreter_call Responses items can stream with an empty item id

2 participants