Repository navigation
fix(runtime): avoid OpenAI tool_search name collision - #3958
Conversation
|
I reviewed this PR at exact head Spec: NO-GO — 2×P1 + 1×P2
Other aspects (resolved-adapter gating for Standards: 2×P3 + 1 judgment-only P2
Title/branch conventions pass and the adapter boundary conforms to Other checks: What I did not check: full local suite beyond the checks noted. Gate: exact head has P1/P2 findings and therefore cannot be approved or merged until the alias bijectivity, prompt/projection, and regression-test issues are fixed and the template/AI disclosure is completed.
|
81d8946 to
84e3ee8
Compare
|
Thanks for the exact-head review. I addressed the in-scope findings in the updated head 84e3ee8: (1) maka_tool_search is now reserved at the Runtime catalog boundary, so the provider alias mapping remains bijective; (2) provider-facing system text and replayed text/tool result content are projected to the alias, while Runtime persistence/UI names remain ool_search; streamed provider tool calls and provider-executed results both map back to the internal name; (3) the regression now exercises the real @ai-sdk/openai Responses converter with openai-codex/gpt-5.6-sol and asserts the emitted wire body. I also restored the required PR template sections, selected substantive AI use, added the Generated-by: Codex trailer, and checked the test/format items. The PR is ready for a fresh exact-head review; there are no inline threads to resolve. |
|
The reviewed findings are now addressed in head 84e3ee8: alias collision is rejected at the Runtime catalog boundary; provider-facing system text, replayed text/tool results, repair callbacks, and streamed provider calls/results all use a consistent transport-only alias; and the regression uses the real @ai-sdk/openai Responses converter with the openai-codex/gpt-5.6-sol path. The required PR template, AI-use declaration, and Generated-by: Codex trailer are also present. CI will rerun for this head. There are no inline threads to resolve. |
84e3ee8 to
21e10bf
Compare
|
Follow-up after the review pass: head is now 21e10bf. I additionally made the text projection token-aware so an existing maka_tool_search string is not double-prefixed, and the real Responses wire test now covers that case. The provider-result mapping is exercised through the streamed provider-result path, and the alias reservation test prevents shadowing. Local affected tests: 20 passed; runtime build and Biome pass. |
Generated-by: Codex
21e10bf to
166204c
Compare
|
Rebased the completed fix onto current |
M4n5ter
left a comment
There was a problem hiding this comment.
I reviewed exact head 166204c59e10d3ecfe7047a52d1cbab5bf7007f2. The transport-only alias now covers the tool schema, active tools, canonical history replay, repair callbacks, and streamed provider calls/results, while Runtime persistence and UI retain the canonical tool_search identity. The regression test reaches the real OpenAI Responses converter and closes the original request-build failure.
I found no P0 or P1 issue. One non-blocking P2 remains in the text-projection boundary; I left the evidence and a narrow repair direction inline. The exact-head test and windows_recovery checks are successful. Local verification covered five affected package builds, 36 focused tests, changed-file formatting, and the clean current-main merge result.
Posted by an automated review agent operated by @M4n5ter. This is not an independent human review and does not satisfy the committer review required by CONTRIBUTING.md. A human is accountable for this comment — please push back if anything here is wrong.
简体中文
本条评论由 @M4n5ter 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md 所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
| ) { | ||
| remapped.output = { | ||
| ...remapped.output, | ||
| value: remapProviderToolNamesInText(remapped.output.value, providerToolName), |
There was a problem hiding this comment.
[P2] Scope tool-name projection to Runtime-owned instructions
I rechecked this against production-derived inputs. The path is narrower than my original wording implied, but it is reachable without a synthetic tool payload:
input.systemincludes user-global and project-ownedAGENTS.md,CLAUDE.md, andGEMINI.mdtext. The blanket replacement atmodel-adapter.ts:280-282changes a project instruction such asKeep the Runtime identifier tool_search canonicaltoKeep the Runtime identifier maka_tool_search canonical.- Write/Edit/FormatJson produce a
textsummary containing the user-selected path. I passed the real production summary fordocs/tool_search.mdthrough the real OpenAI Responses converter; the wire output saiddocs/maka_tool_search.md. Goal and Task Ledger string outputs similarly contain user-defined goal conditions and task subjects.
Ordinary Read, Bash, and MCP outputs use outer json or content arms and are not rewritten, so they are not affected. I also narrowed the opposite case: the live deferred-tool refusal is error-text and is projected correctly; only a later durable replay rematerializes it as error-json and retains Call tool_search. The primary impact is therefore the silent mutation of supported project/user text, not an immediate recovery failure.
Please keep alias translation on structural toolName fields and explicitly Runtime-owned provider instructions. Preserve project/user text and ordinary result payloads byte-semantically, and cover one workspace-instruction or production Write-summary case in the real-wire regression.
Posted by an automated review agent operated by @M4n5ter. This is not an independent human review and does not satisfy the committer review required by CONTRIBUTING.md. A human is accountable for this comment — please push back if anything here is wrong.
简体中文
本条评论由 @M4n5ter 运行的自动化审查程序发出。它不构成 CONTRIBUTING.md 所要求的独立人类审查,也不能替代人类审查。有人类对本条评论负责,如有错误请直接指出。
Summary
Fixes #3939
Maka's deferred-tool connector keeps the internal name
tool_search, but the provider-bound OpenAI Responses request uses the collision-free aliasmaka_tool_search. Provider-facing system text, replayed tool call/result names, repair callbacks, and streamed provider tool results are mapped consistently at the adapter boundary. The alias is reserved so a real tool cannot shadow it.Verification
npm --workspace @maka/core run buildnpm --workspace @maka/storage run buildnpm --workspace @maka/mcp run buildnpm --workspace @maka/computer-use run buildnpm --workspace @maka/runtime run buildnode --test "packages/runtime/dist/__tests__/deferred-tools-wire.test.js" "packages/runtime/dist/__tests__/responses-wire-contract.test.js"(20 passed)The Responses wire regression uses the real
openai-codex/gpt-5.6-soladapter and@ai-sdk/openaiconverter. It proves the historical{ activated: [...] }result is sent as a generic function output undermaka_tool_search, and that provider tool calls/results map back to Maka's internaltool_searchidentity.Review focus
The provider alias is a transport-only projection. Runtime persistence, UI copy, activation payloads, and existing history remain on the internal name. A real
maka_tool_searchtool is rejected at catalog construction to preserve bijective mapping.AI use
Select exactly one:
Tool(s) and scope: Codex authored the implementation, tests, and review follow-up; the human contributor reviewed the changes and owns the submission.
Checklist
Does this PR entail a change in behavior?