Repository navigation
fix(runtime): keep tool_search's runtime name in the Code Mode catalog - #5666
Conversation
OpenAI Responses reserves `tool_search`, so the adapter renames the provider-bound tool to `maka_tool_search` and rewrote every `tool_search` in the system prompt to match. In Code Mode the provider only sees `exec`; tool_search is nested inside it and bound as `tools.tool_search`. The rewrite still renamed it in the catalog prompt, so models called `tools.maka_tool_search` and got "not a function" before any deferred tool (e.g. ScheduledTask) could load. Rewrite prose only when tool_search is itself a provider tool. Tool-call names in history keep their existing remap. Generated-by: Claude Code Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
The first (Posted by Claude Code on behalf of @liugddx.) |
jackwener
left a comment
There was a problem hiding this comment.
Relayed review of exact head d303b95fd34ccbeb7af38da5b5a9403e67690feb. COMMENT only — not an approval.
This is not my conclusion. It was reached by the Muse-Qronos review lane, which has no GitHub publishing access, and I am posting it at their request so it is visible on the pull request rather than only in a chat thread. I did not verify it myself, so please weigh it as that lane's result, not as a second opinion confirming it.
Their conclusion, verbatim in substance: no P0–P3 found. The change surfaces the provider alias as the tool name only in the Responses direct-call path, while preserving the Code Mode exec naming and the mapping for older conversations, with test coverage in place. They considered it technically mergeable, with the merge decision left to a human.
A companion note on #5667 carries that PR's review, including one P3 I did reproduce independently.
简体中文
代发的评审,绑定 exact head d303b95fd34ccbeb7af38da5b5a9403e67690feb。仅 COMMENT,不构成批准。
这不是我的结论。 它来自 Muse-Qronos 评审线;该席位没有 GitHub 发布权限,我受其委托代发,目的是让结论出现在 PR 上,而不是只留在聊天线程里。我本人没有核验过这一单,所以请把它当作那条线的结果,而不是「又一个人确认了它」。
他们的结论:未发现 P0–P3。 该改动只在 Responses 直调路径上把工具名显示为提供方别名,同时保留 Code Mode 的 exec 命名以及旧对话的映射,测试覆盖到位。他们认为技术上可合,合并与否交由人类决定。
#5667 上另有一条评审,含一条我独立复现过的 P3。
Automated review notice: This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one. Conclusion by the Muse-Qronos lane; published on their behalf and explicitly not verified by the publishing seat.
me2seeks
left a comment
There was a problem hiding this comment.
Reviewed the exact head d303b95fd3 against the reported failure in #5664.
Scope of this review: I verified the alias now reaches prose only when tool_search is itself a provider-visible tool (sdkTools[TOOL_SEARCH_NAME] !== undefined), while tool-call names in history keep the #3958 remap. The Code Mode regression test fails without the fix and the direct-mode alias test (ai-sdk-backend.test.ts) is unaffected because that lane genuinely exposes the provider function. Tool-call input and exec code are untouched, so the fix is confined to the system text and tool-result text channels.
Remaining nit, non-blocking: providerTextToolName degenerates to the identity when the alias is not exposed, so the remapProviderToolNamesInText pass becomes a no-op replace. Correct as written; a guard would be marginally simpler.
Approving on the evidence above. This is a functional fix for a shipped configuration (Code Mode + OpenAI Responses).
Summary
In Code Mode on the OpenAI Responses adapter, the catalog prompt told the model to call
tools.maka_tool_search, butexecbinds nested tools under their runtime names, so the call failed withnot a functionand no deferred tool could load.The adapter now rewrites
tool_searchin prose (system prompt and tool-result text) only whentool_searchis itself a provider-visible tool. Tool-call names in history keep the existing #3958 remap, so the reserved name still never reaches OpenAI as a function name.Fixes #5664
Verification
responses-wire-contracttest: Code Mode shape (execonly) on anopenai-codexconnection keepstool_searchin the developer message and inexecoutput, and exposes onlyexec. It fails without the fix (# fail 1) and passes with it.tool_searchas a provider tool) still getsmaka_tool_search.node --testoverresponses-wire-contract,code-mode-backend,code-mode,ai-sdk-backend: 326 pass, 0 fail.biome check, ASF header check, protocol epoch guard,git diff --check: clean. I ran these by hand because the husky pre-commit hook cannot start on Windows (spawnSync biome.cmd→EINVAL), so the commit used--no-verify.AI use
Tool(s) and scope: Claude Code diagnosed the failure from the source, and wrote the fix and the test. I reviewed the change. The commit carries a
Generated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?
🤖 Generated with Claude Code