Repository navigation
fix: preserve tool safety on translated Messages fallbacks - #7919
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Translated tool rules src/claude/inbound-content-options.ts, src/claude/compatibility.ts |
Translated routes omit hosted search when a search declaration has its own allowed_domains, blocked_domains, or user_location property. Forced search selection raises an error when no hosted search declaration remains. Compatibility checks allow valid deferred function definitions and continue to reject unsupported deferral cases. |
Integration validation tests/claude-integration/*, scripts/test-layout/layout-clients.json, tests/fixtures/test-layout-expected.json |
Integration tests cover restricted and unrestricted search translation, fallback to Responses and Chat, forced search selection, and deferred-tool compatibility. The test layout includes the new test file. |
Tool handling documentation docs-site/src/content/docs/guides/claude-code.md, docs-site/src/content/docs/*/guides/claude-code.md, structure/clients/claude-desktop.md, structure/data-planes/claude-tool-loading.md |
The English and localized guides, client documentation, and tool-loading documentation describe the translated-route restrictions and deferred-function handling. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Possibly related issues
- Issue 7912 concerns translated Claude WebSearch behavior. This change addresses restricted-search omission and forced selection, but does not fully address the issue’s native-lane and sidecar-selection failures.
- Issue 7655 concerns authorization for deferred catalog tools in a Responses
additional_toolsstream. This change updates deferred-tool admission but does not address the separate reported transport or test-harness problem.
Suggested reviewers: ingwannu, luvs01
Merge Risk: 
Minimal · up to 4204f
-
No actionable merge-blocking risk is established, though the reported focused test run was not green.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 5 files. (12 skipped: 12 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
|
✅ Deterministic PR hygiene checks passed. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
web_search*declaration suppliesallowed_domains,blocked_domainsoruser_location, omit hosted search from the shared translated catalog and sidecar path. Duplicate declarations cannot bypass omission; a forced omitted search refuses locally. Original typed tools still reach first-party Anthropic when translation proceeds.defer_loadingfunction definitions callable as ordinary functions on unsupported wires, including compatibility-enforced requests. This is eager-loading degradation, not native deferred discovery; unsupported top-level deferral and server-executed discovery retain admission checks. Existing direct-route append-only loading stays intact.Verification
origin/devatf5a5e5bcf09136b310b420f71a139efbc2b33311; Bun 1.4.4;bun install --frozen-lockfilepassed. Test invocations useOCX_TEST_NO_QUEUE=1; one Bun test process at a time.bun test tests/claude-integration/claude-translated-tool-restrictions.test.ts— 1 pass / 9 fail, unexpected unrestricted hosted/synthetic search on both physical wires. Additional forced-search/eager-admission regressions failed 0 pass / 2 fail before those fixes.bun test <35 focused files>; file list and full output retained in local scratch.present invalid compatibility modes return one fixed 503 before translationhit a Windows startup ACL error (EICACLS,/grant:r) and the existing 5000ms timeout. No assertion, timeout, retry, skip or production lock was weakened; this run is not reported green.bun run test --parallel=1 ./tests/claude-integration/claude-messages-endpoint.test.ts --test-name-pattern 'present invalid compatibility modes return one fixed 503 before translation'at unchangedf5a5e5bcf09136b310b420f71a139efbc2b33311— 0 pass / 1 fail / 1 error / 53 filtered, exit 1, one run. The same 5000ms timeout reproduced (6236ms), followed byENOENTwriting the removed fixture config. The timeout is inherited; the base comparison does not establish the original delay or explain the candidate run's secondaryEICACLSerror.bun run typecheckpassed (2,227 files).bun run structure:checkandbun run privacy:scanpassed. Test-layout/tooling, file-size ratchet and Lab-boundary guards passed within the broad focused run.cd docs-site; bun install --frozen-lockfile; bun run buildpassed — 593 pages and 85,247 internal links checked.Exact 35-file focused test command
OCX_TEST_NO_QUEUE=1 bun test \ tests/claude-integration/claude-alias.test.ts \ tests/adapters/openai/openai-chat-system-order.test.ts \ tests/claude-integration/claude-inbound-tool-reference.test.ts \ tests/claude-integration/claude-inbound-debug.test.ts \ tests/claude-integration/claude-inbound-token-footer.test.ts \ tests/claude-integration/claude-inbound-tool-loading.test.ts \ tests/claude-integration/claude-inbound-cache-stabilize.test.ts \ tests/claude-integration/claude-intercept-model-bindings.test.ts \ tests/claude-integration/claude-inbound.test.ts \ tests/claude-integration/claude-native-fast-1m-ingress.test.ts \ tests/claude-integration/claude-output-schema-strict.test.ts \ tests/claude-integration/claude-native-reasoning-provenance.test.ts \ tests/claude-integration/claude-native-reasoning-continuity.test.ts \ tests/responses/chat-inline-document-bytes.test.ts \ tests/claude-integration/claude-source-envelope.test.ts \ tests/adapters/anthropic/anthropic-reasoning.test.ts \ tests/responses/chat-inbound-developer-position.test.ts \ tests/claude-integration/claude-subagent-model-force.test.ts \ tests/adapters/anthropic/anthropic-tool-declaration-constraints.test.ts \ tests/claude-integration/claude-translated-cache-ttl.test.ts \ tests/adapters/anthropic/anthropic-thinking-signature.test.ts \ tests/responses/openai-responses-summary-none.test.ts \ tests/responses/protocol-features.test.ts \ tests/responses/openai-responses-passthrough.test.ts \ tests/responses/messages-native-bridge-policy.test.ts \ tests/responses/reasoning-envelope.test.ts \ tests/responses/protocol-messages-ir-parity.test.ts \ tests/responses/responses-forward-prompt-envelope.test.ts \ tests/claude-integration/claude-translated-server-tools.test.ts \ tests/claude-integration/claude-tool-loading-destinations.test.ts \ tests/claude-integration/claude-messages-endpoint.test.ts \ tests/test-layout.test.ts \ tests/test-layout-tooling.test.ts \ tests/ci-workflows/file-size-ratchet.test.ts \ tests/lab/core-lab-boundary.test.tsChecklist
Summary by CodeRabbit