You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Translated route drops tool_reference blocks from tool results, so ToolSearch returns empty and routed models call it in a loop #6647
Claude Code's ToolSearch tool answers with a tool_result whose content is only tool_reference blocks ([{"type":"tool_reference","tool_name":"Bash"}, …]). On the translated Claude Messages → Responses route, toolResultOutput in src/claude/inbound.ts keeps text, image and document items and drops everything else, so the routed model receives an emptyfunction_call_output for every ToolSearch call. It concludes the tools did not load and calls ToolSearch again; one subagent made 26 ToolSearch calls in 9 minutes, restarting its plan after each.
Expected: the routed model sees which tools were loaded, as it does for any other tool result. src/claude/compatibility.ts already lists tool_reference as a supported result block type, so the translation is expected to carry it.
When it happens. Claude Code only keeps tool search on when it believes it is talking to Anthropic. That is the case in the first-party desktop intercept mode (desktopMode: "first-party"), where ANTHROPIC_BASE_URL is not set. #4838 covers the opposite configuration (gateway mode turns tool search off). In first-party mode the deferral stays on and tool_reference results do flow through the translation, where they are dropped.
Fix that works here. In toolResultOutput, map a tool_reference item to text:
With that one branch the routed model loads its tools once and moves on.
Reproduction
Run opencodex with a Claude Code route translated to a Responses model (here a combo whose first member is meta-muse/muse-spark-1.3-contributor).
POST /v1/messages with a history containing an assistant tool_use for ToolSearch (input {"query":"select:WebFetch"}), followed by a user tool_result for it with content [{"type":"tool_reference","tool_name":"WebFetch"}], then a user text message: Repeat the tool result you received, verbatim.
Observe: the model reports an empty tool result. With the fix above, it answers Tool loaded: WebFetch.
Version
2.76.0 (also present in 2.78.0-preview.20261005)
Operating system
macOS 26.6.2 (arm64); also macOS 26.7.1 (arm64)
Provider and model
meta-muse / muse-spark-1.3-contributor (via combo); not provider-specific, the drop happens before routing
Logs or error output
No response
Screenshots and supporting files
No response
Redacted configuration
No response
Checks
I searched existing issues and documentation.
I removed secrets, tokens, account details, request credentials, and personal data.
Prepared draft #6660 at 502b6e38fb6a0b46f51b84ab8e8f0a36b13f0a8f, based on current dev f924820652. The unchanged-source regression produced 1 pass/2 fail, confirming the missing reference-only and mixed-content result blocks. The fix passes 140 tests across six focused translation/layout files and the structure check.
This preserves loaded-name evidence in the paired result without adding tool declarations or enabling translated server-side deferral. Typecheck reached the strict 180-second resource deadline and remains unverified; full/import-connected coverage, docs build and required current-head CI/review are still outstanding. The PR therefore stays Draft. No live provider request, installed-client operation or security/privacy scan was performed, and no release or live-loop resolution is claimed. Keeping this issue open until the fix is accepted and lands.
Fixed on dev by #6660 (merge aed4f1c): translated Claude routes now carry tool_reference results as 'Tool loaded: ' lines, so ToolSearch no longer returns empty output. It ships with the next release cut from dev.
Activity
github-actions commentedon Oct 5, 2026
Issue reopened
The report now contains the information required by the automated check. Thanks for updating it.
Ingwannu commentedon Oct 6, 2026
Prepared draft #6660 at
502b6e38fb6a0b46f51b84ab8e8f0a36b13f0a8f, based on current devf924820652. The unchanged-source regression produced 1 pass/2 fail, confirming the missing reference-only and mixed-content result blocks. The fix passes 140 tests across six focused translation/layout files and the structure check.This preserves loaded-name evidence in the paired result without adding tool declarations or enabling translated server-side deferral. Typecheck reached the strict 180-second resource deadline and remains unverified; full/import-connected coverage, docs build and required current-head CI/review are still outstanding. The PR therefore stays Draft. No live provider request, installed-client operation or security/privacy scan was performed, and no release or live-loop resolution is claimed. Keeping this issue open until the fix is accepted and lands.
fix(claude): retain ToolSearch references in translated results (#6660)
lidge-jun commentedon Oct 6, 2026
Fixed on dev by #6660 (merge aed4f1c): translated Claude routes now carry tool_reference results as 'Tool loaded: ' lines, so ToolSearch no longer returns empty output. It ships with the next release cut from dev.