Skip to content

fix(claude): preserve caller restrictions before chat dispatch - #8814

Closed
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/chat-dispatch-caller-restrictions
Closed

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/chat-dispatch-caller-restrictions

Conversation

@luvs01

@luvs01 luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The optional Chat tool dispatcher removed deferred declarations before the existing adapter guard checked allowed_callers. A restrictive tool could therefore disappear from the guard's view and later reappear as an ordinary direct tool call when use_loaded_tool was rewritten.

  • Leave the original catalog and history intact whenever the existing shared toolRestrictsCallers predicate identifies a caller restriction.
  • Let the existing Chat adapter guard reject the unsupported declaration before any upstream send.
  • Preserve normal projection and streamed/buffered tool-call rewriting for absent caller lists or exactly ["direct"].
  • Update the owning tool-loading contract and English, Spanish and Korean guidance.

Verification

Recorded local validation:

  • Independent prepatch inspection and a bounded component proof confirmed the wrapper/guard ordering: programmatic-only and empty deferred caller lists passed after projection, while eager restrictions still failed. Both response parser forms rewrote the dispatcher into a direct restricted-tool call.
  • New regressions on the original source with an explicit fake provider executor: 17 failed, two absent/direct-only controls passed. All 16 restricted endpoint cases reached the fake provider once.
  • Corrected routing test file: 34 passed / 213 assertions. It covers loaded/unloaded tools, streaming/JSON clients, four restrictive list forms, unchanged parsed data, real adapter guard ordering, zero upstream dispatch, fixed sanitized error bodies and normal direct-only roundtrips.
  • The existing dispatcher file (23 passed) and Anthropic declaration-constraints file (11 passed) passed in the earlier combined run; they were unchanged by the later route-test-only expectation correction.
  • Typecheck: 2,536 files, no errors. Structure and privacy passed. File-size/localization checks: 39 passed / 3,311 assertions, with no raised caps.

For current head 39085c25b855af34eeeb605026b5de04666f83f5, main pull-request CI and Catalog async contracts completed successfully. These are the configured pull-request checks; skipped platform jobs do not establish Windows/macOS acceptance.

CodeRabbit has not reviewed this Draft PR. Maintainer security review and installed/live application validation remain separate. This PR remains Draft; it does not claim merge or release acceptance.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

The security checkbox records implementation review; explicit maintainer security review remains required before merge.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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.

Share

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 16, 2026
lidge-jun added a commit that referenced this pull request Nov 17, 2026
… gate explicit SSH routes (#8868)

Lane R4 of the 2026-11-17 triage round: refuse redirects on Anthropic bearer requests (#8758), keep caller restrictions visible to the Chat tool-dispatch guard (#8814), and require owner authority for explicit SSH routes (#8806).

Co-authored-by: Vadym O <[email protected]>
Co-authored-by: Epinephrine <[email protected]>
@lidge-jun

Copy link
Copy Markdown
Owner

Thank you. This change was carried, with your authorship kept as a Co-authored-by trailer, in #8868, which is now merged into dev as bfdb2bc (2026-11-17 triage round). Closing as superseded; see #8868 for any follow-up changes made during review.

@lidge-jun lidge-jun closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants