Skip to content

fix(vision): apply caller model scope to the selected helper - #9061

Merged
lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:codex/vision-helper-selection
Nov 25, 2026
Merged

lidge-jun merged 4 commits into
lidge-jun:devfrom
luvs01:codex/vision-helper-selection

Conversation

@luvs01

@luvs01 luvs01 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • 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.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Changes: Vision sidecar admission

Layer / File(s) Summary
Routed target admission
src/vision/plan.ts, tests/vision/vision-cache.test.ts, structure/gui-and-management-api.md
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.
Scoped fallback selection
src/vision/plan.ts, tests/vision/vision-anthropic-instance-sidecar.test.ts, docs-site/src/content/docs/guides/sidecars.md, docs-site/src/content/docs/ko/guides/sidecars.md, structure/runtime.md
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.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: Minimal · previous review d3aa8

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: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8961476 and d3aa8c2.

Files selected for processing: 7

  • docs-site/src/content/docs/guides/sidecars.md
  • docs-site/src/content/docs/ko/guides/sidecars.md
  • src/vision/plan.ts
  • structure/gui-and-management-api.md
  • structure/runtime.md
  • tests/vision/vision-anthropic-instance-sidecar.test.ts
  • tests/vision/vision-cache.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 23, 2026

luvs01 commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@lidge-jun
lidge-jun marked this pull request as ready for review November 25, 2026 04:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-25T04:54:20.093867Z d3aa8c2 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun

lidge-jun commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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.
  • scripts/ci/assert-mergeable-review.sh --maintainer-integration 9061: OK: validation snapshot for fix(vision): apply caller model scope to the selected helper #9061 into dev at head 7539763…
  • 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.
  • Earlier red test changed CI failures (link relay, parent CLI teardown) were timing flakes fixed on dev by test: stabilize Link preflight and standalone stop checks #9064. This head passes test changed.
  • The relaxed behind-dev gate was checked before merging:
    • (a) head 7539763 is 1 commits behind dev ea9a9e6: docs(update): describe preview version names and ordering #9073
    • (b) git merge-tree --write-tree ea9a9e6 7539763: clean
    • (c) intervening dev commits change 9 files; overlap with PR files: none; shared-class files touched by the PR: none
    • (d) on local unpushed merge 1d83a7a99a (7539763 + dev ea9a9e6): typecheck: ✓ No type errors in 2,703 files [327.25ms]; structure:check: structure/ SSOT checks passed; tests: vision/vision-cache.test.ts 22 pass 0 fail ;vision/vision-anthropic-instance-sidecar.test.ts 9 pass 0 fail ;vision/vision-eligibility.test.ts 22 pass 0 fail ;vision/vision-routed.test.ts 13 pass 0 fail ;test-layout.test.ts 2 pass 0 fail ;test-layout-tooling.test.ts 27 pass 0 fail ;ci-workflows/file-size-ratchet.test.ts 9 pass 0 fail ;ci-workflows/skill-ocx.test.ts 15 pass 0 fail
  • 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.

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