fix(tools): support namespaced custom tool aliases - #1934
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. |
Summary
Preserve
customtools nested inside Responses namespace declarations and lower them through each routed adapter with their flattened wire name.Resolve a bare namespaced
tool_choiceonly when the logical name is unique in the complete request catalog, then restore that exact alias as a custom tool call.Carry tool kind per wire alias across streaming, buffered, image, and web-search bridges so same-named custom and function tools remain distinct while undeclared or ambiguous calls still fail closed.\n- No user-facing configuration or documentation contract changes.\n\n## Verification
bun test tests/responses-parser.test.ts tests/responses-tool-conformance.test.ts tests/reasoning-effort.test.ts tests/tool-catalog-nudge.test.ts tests/command-code-provider.test.ts(135 pass,0 failbefore the final collision-parity test was added)bun test tests/responses-tool-conformance.test.ts(24 pass,0 fail, including the final streaming/non-streaming same-name collision case)bun run typecheckbun run privacy:scangit diff --checkbun run test(12750 pass,15 skip,3 failacross 823 files). Two failures reproduce unchanged on an untouchedupstream/devcheckout: the competing-OFF Codex sync race and the configured-catalog EACCES case when run as root. The CL-03 output-byte-limit case timed out only under the 1108-second loaded full run;bun test tests/lab-live-pinned-timeouts.test.tspassed all 3 cases immediately afterward.Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.