Repository navigation
fix(messages): enforce admission scope on Advisor models - #6617
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
✅ Deterministic PR hygiene checks passed. |
A system message with a temporary clear_at still covers the current turn. Count its tool additions, honor only permanent removals, and keep a declaration shadowed by a temporary replacement in scope.
Independent security review (lane B5) — bound to head
|
|
Maintainer integration (lidge-jun, dev only) — 2026-10-05 bug triage round 2, lane B5.
|
Summary
A model-scoped data key can select an allowed Messages executor while a preserved Advisor tool names a different, separately billed model. Carry the admission scope into managed native Messages and check active Advisor destinations before credential preparation or dispatch.
clear_at: "never"messages.This follows the managed native behavior in #6559. The affected new allowance is not in main/latest release 2.77.0. Anthropic's Advisor contract defines the nested model as a billed sub-inference; its inline tool contract defines the lifecycle rules used here. No live account entitlement or provider charging is claimed.
Verification
Base:
e53c8077e40b6f540bf1e5d5791a55282466bfac. Head:e2cd8cf72b06cc942d0ff3d498e5367bc9425e9b. Windows, Bun 1.4.2.bun scripts/test.ts --parallel=1 tests/claude-integration/messages-native-scope.test.ts tests/claude-integration/messages-native.test.ts tests/claude-integration/messages-native-oauth.test.ts tests/server/api-key-model-scope.test.ts tests/test-layout-tooling.test.ts --timeout 30000: 120 passed, 0 failed, 1275 assertions.clear_at: "never"bypass and removal regression. Three added cases failed before correction. The matrix above includes the correction.tests/claude-integration/messages-native-scope.test.tsafter that fixture-only adjustment: 24 passed, 0 failed, 88 assertions. Runtime source is identical to the 120-test run.No paid provider call, installed runtime, credential selection or live policy was changed. Independent local review is not project-maintainer approval. Keep Draft pending the required admission/credential boundary review and final-head validation.
Checklist
Review readiness checklist
Maintainer update (lane B5), head
113bc200aafdb7ed319d560a4e754cc147a8f9f8dev.cdacd4f0edmakes the Advisor scope check fail closed for system messages whoseclear_atis notnever: additions always count, only permanent removals withdraw, and a temporary replacement keeps the shadowed declaration.113bc200aachanges only docs and fixtures, which now use the documentednext_user_messagevalue.bun run typecheck,bun run structure:check,bun run privacy:scan, andbun scripts/file-size-ratchet.tsall exit 0. Behavioral evidence comes from hosted PR CI at this head.