You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(vision): apply caller model scope to the selected helper - #9061
Check the caller's and host's model permissions against the provider and model selected for Vision processing. A helper that is unavailable can still be replaced by an eligible one. The planner and Vision credential preparation now agree on when that helper may be used.
Document the selection contract in the English and Korean sidecar guides and the owning structure documents.
Verification
Applied the candidate to 9e0e298ef. On Windows with Bun 1.4.4, three new authorization tests and seven existing permitted-path tests all passed (41 assertions).
The tests exercise local selection with synthetic inputs. No live provider credentials or image transfers were needed.
bun check --no-script --noEmit passed for 2,691 files. bun scripts/structure-ssot.ts and git diff --check passed.
Local checks focused on the affected planner and credential preparation during concurrent Windows testing. A full local test run and site build were not part of that verification.
Checklist
Scope stays within Vision helper selection and its documented behavior.
Updated the sidecar guides and structure contracts.
Independently reviewed the authorization change and the allowed fallback behavior. Maintainer security review is requested.
Summary by CodeRabbit
Bug Fixes
Vision sidecars now check that the requesting API key is authorized for the selected provider and model, including fallback models. If a routed helper is unavailable, an authorized native fallback may be used; if access is refused, helper selection stops. Text-only requests can continue without image content.
Documentation
Updated the Vision sidecar and runtime guides to explain authorization checks and fallback behavior.
Clarified how provider capability declarations differ from runtime authorization in the management API guide.
Reviewing files that changed from the base of the PR and between d3aa8c2 and 7539763.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Vision planning now checks caller and advisor admission scopes for routed targets and fallback models. It distinguishes denied targets from unavailable targets, updates OpenAI model resolution, and adds tests and documentation for scope-filtered planning.
src/vision/plan.ts intersects caller and advisor scopes and checks authorization for routed targets. A denied target stops planning, while an unavailable target can proceed to fallback selection. Tests cover scope and modality checks. The API documentation distinguishes catalog capability from runtime key-scope checks and describes the shared PUT /api/combos transaction.
OpenAI model resolution uses the effective-model resolver. OpenAI and Anthropic fallback plans are omitted when the selected provider or model is outside the effective scope. Tests cover provider and model filtering. The sidecar guides and runtime documentation describe authorization requirements for fallback models.
Vision sidecar planning now checks key scopes against the selected helper and fallback models, and requests that can continue do so without the image when the helper is refused. No concrete defect remains in the reviewed changes. The failing CI cases belong to unrelated test fixtures that a separate PR fixes, so this change is ready to merge once CI is green.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(vision): apply caller model scope to the selected helper" matches the main change. The PR checks caller and host model permissions against the Vision helper selected by the planner. The…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(vision): apply caller model scope to the selected helper" matches the main change. The PR checks caller and host model permissions against the Vision helper selected by the planner. The title names the fix and the affected component (vision). It does not cover the fallback-target logic or the documentation updates, which is acceptable for a title.
Finishing Touches
Generate unit tests (beta)
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The two failures on 336ae76ba are in the Link preflight and standalone stop test fixtures. #9064 fixes their timing assumptions against dev and changes only those two test files. Its Ubuntu changed-test log records the Link case and all six standalone record cases passing, including the POSIX-only case.
I also checked the combined tree ff12d90d5 on Windows x64. The six applicable cases passed with 58 assertions, and the POSIX case was skipped. The original CI result on this PR is still failed. Once #9064 lands, this branch can pick up dev and be checked with both changes together.
Maintainer integration into dev (MAINTAINERS.md, dev-only path), recorded before merge.
Head: 753976303dfb9fbf47ec87ce1122a79127de6ac7. It is 2 commits behind dev at a16e380afe.
PR checks passing on this head: Catalog async contracts (ubuntu-latest), api usage, changes, ci, docker smoke, docs site build, enforce / enforce-target, enforce / resolve-pr, gates, hygiene / hygiene, label / label, npm-global ubuntu-latest, select windows runner, storage policy, structure gate, test changed, validate-source. The remaining jobs were skipped by the PR lane policy.
Local checks on the PR head d3aa8c2cf3, before the latest dev merge: bun run typecheck found no errors in 2,701 files. bun run test:changed ran 27,550 tests across 1,086 files with 2 failures. cli-headless-parity was a timeout under host load and reran green (112/112); link-ocx-child-e2e needs a cargo toolchain that this host does not have. On the current head 753976303d, focused Vision tests passed: vision-cache 22/22, vision-anthropic-instance-sidecar 9/9, vision-eligibility 22/22, vision-routed 13/13.
Independent security review (GPT-6.1 Terra): no code-level findings. The change narrows the Vision helper to the caller's and host's model scope.
Security sign-off by the coordinator on behalf of the owner: scope narrowing only.
This PR has no readiness checklist section, so I marked it ready after this validation.
Note: dev advanced one commit between the (a)–(d) check and the merge: a16e380afe (#9022, Windows local-control socket). It changes 9 files in the link and local-control code, the server test-layout map and expected fixture, and structure/remote-link.md. None of these overlap this PR's files, and this PR touches no shared-class file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Check the caller's and host's model permissions against the provider and model selected for Vision processing. A helper that is unavailable can still be replaced by an eligible one. The planner and Vision credential preparation now agree on when that helper may be used.
Document the selection contract in the English and Korean sidecar guides and the owning structure documents.
Verification
9e0e298ef. On Windows with Bun 1.4.4, three new authorization tests and seven existing permitted-path tests all passed (41 assertions).bun check --no-script --noEmitpassed for 2,691 files.bun scripts/structure-ssot.tsandgit diff --checkpassed.Checklist
Summary by CodeRabbit