Repository navigation
fix(anthropic): enforce model routes for vision and search helpers - #6371
Conversation
The web-search sidecar test drives runAnthropicWebSearch end to end and asserts the captured Authorization header is the route-selected account's token. Also document in providers-and-adapters.md that helper sends share the model-route authority and a strict empty route fails the helper locally.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 17 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (13)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughAnthropic vision and web-search sidecars now use model-route-aware token resolution when configuration is available. The sidecar paths retain and pass ChangesAnthropic sidecar authentication
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant runAnthropicWebSearch
participant getAnthropicSidecarAccessToken
participant resolveAnthropicModelRoute
participant AnthropicAccountPool
runAnthropicWebSearch->>getAnthropicSidecarAccessToken: provider name, model, and config
getAnthropicSidecarAccessToken->>resolveAnthropicModelRoute: resolve model route
resolveAnthropicModelRoute-->>getAnthropicSidecarAccessToken: selected account
getAnthropicSidecarAccessToken->>AnthropicAccountPool: obtain selected account access token
AnthropicAccountPool-->>getAnthropicSidecarAccessToken: access token
getAnthropicSidecarAccessToken-->>runAnthropicWebSearch: access token
Merge Risk: ⚪ Minimal · up to Anthropic vision and search helpers now use model-routed credentials and reject empty strict routes locally. No actionable merge-blocking defect is established; normal checks and required approvals still apply. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change narrows which account may authorize helper requests and refuses routes without a permitted account. No newly introduced authorization bypass was established, but older calling conventions and concurrent configuration changes still need stronger assurance. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 76.92% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 12 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 722345fc4f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Follow-up verification for Exercise the real vision-sidecar configuration path with synthetic routed Authorization and strict-empty no-transmission regressions; document independently routed vision and web-search helper models. Production runtime is unchanged. Temporarily omitting the sidecar configuration caused both new regressions to fail. After restoring the unchanged runtime, the complete targeted model-route suite passed 48 tests with 259 assertions. The local docs build failed while creating a shared Vite cache directory (ENOENT); no successful local docs build is claimed. Hosted documentation CI is checked separately on this HEAD. Executed focused commands:
Required typecheck, structure, privacy and file-size checks passed. Full local suite and unfiltered Cross-platform CI succeeded for this exact HEAD. Checkout Independent maintainer approval, explicit security review and any required sponsorship remain pending before merge. |
|
Maintainer integration record (MAINTAINERS.md, dev only)
|
Summary
Anthropic vision and web-search helpers could use the globally active OAuth account even when a model route excluded that account. Resolve helper credentials through the same per-model route as primary requests and carry the admitted configuration snapshot through sidecar planning and execution. An empty strict route is refused locally; a helper cannot silently use an excluded account.
Source history is preserved through commit
74e731eb6879d3931108536afd7bd98d00bcbd9d. The local validation below used the integration withdevat0328373fb88fe0d019b29ae278e153d7fed4bcc7.Verification
Current follow-up
Follow-up verification for
5540486ea6c7e80b7b9e6f1bfd1f8e7f9ed298e6:Exercise the real vision-sidecar configuration path with synthetic routed Authorization and strict-empty no-transmission regressions; document independently routed vision and web-search helper models. Production runtime is unchanged.
Temporarily omitting the sidecar configuration caused both new regressions to fail. After restoring the unchanged runtime, the complete targeted model-route suite passed 48 tests with 259 assertions. The local docs build failed while creating a shared Vite cache directory (ENOENT); no successful local docs build is claimed. Hosted documentation CI is checked separately on this HEAD.
Executed focused commands:
bun test ./tests/adapters/anthropic/anthropic-model-routes.test.ts— passed.Required typecheck, structure, privacy and file-size checks passed. Full local suite and unfiltered
test:changedwere not run; the documented focused/resource exception and remaining coverage limitations remain in effect. No blocked broad Kiro/SOCKS transport test or real-provider validation is claimed.Cross-platform CI succeeded for this exact HEAD. Checkout
2630a789798dcd5a1623d4fe8fa431539d12e0e8and the PR HEAD share treefcd0750707006de8c5a5497fe82585c8bd068086. Skipped jobs remain skipped.Independent maintainer approval, explicit security review and any required sponsorship remain pending before merge.
Earlier integration evidence
Current upstream integration:
a6114b62ed1b65dede802359ccd373d913979b24; published HEAD722345fc4fc32493cbadc784ae6d796a7f8be84a. The source history through74e731eb6879d3931108536afd7bd98d00bcbd9dis retained without rewriting authors or commits. The PR-specific change was checked again after this integration; typecheck, structure, privacy and file-size gates passed. Cross-platform CI succeeded for this exact HEAD; its checkout tree matches the published HEAD tree. Skipped jobs remain skipped.Windows, Bun 1.4.0, isolated test temporary directory:
bun test tests/adapters/anthropic/anthropic-model-routes.test.ts tests/responses/responses-state-snapshot-select.test.ts: initial run had 47 passed, 3 failed, and 2 errors from timeout/contamination. The three affected cases were retried unchanged with the existing five-second cap.bun test tests/adapters/anthropic/anthropic-model-routes.test.ts --test-name-pattern "^(?:anthropic: a pacing-time pause skips a cooled successor for a healthy account, pool enabled=false|openai-responses: (?:pause with unusable survivors during pacing matches fresh admission|a pacing-time pause skips a cooled successor for a healthy account), pool enabled=false)$": 3 passed, 43 filtered, 0 failed, 18 assertions. This is a successful narrow retry, not a claim that the original combined run passed.bun node_modules/typescript/bin/tsc --noEmit: passed.bun scripts/structure-ssot.ts: passed.bun scripts/privacy-scan.ts: passed.bun scripts/file-size-ratchet.ts: passed.git diff --cached --check 0328373fb88fe0d019b29ae278e153d7fed4bcc7: passed.Focused fixtures use synthetic credentials and controlled provider responses. The full local suite and
test:changedwere not run under the focused-validation exception because concurrent isolated worktrees made the full suite impractical. The initial timeouts above remain part of the evidence. Exact-HEAD CI succeeded; results from another HEAD are not its verification.Checklist
5540486ea6c7e80b7b9e6f1bfd1f8e7f9ed298e6, known correct findings are addressed, and exact-HEAD CI is complete; author review readiness is confirmed.Independent maintainer approval, explicit security review, and any required
maintainer-sponsoreddecision remain pending before merge. These are separate from author review readiness; no approval or sponsorship is claimed.Summary by CodeRabbit