Skip to content

feat(vision): routed describer backend — any picker-visible image-capable model (#2188) - #2306

Merged
lidge-jun merged 7 commits into
devfrom
codex/vision-routed-sidecar
Aug 21, 2026
Merged

lidge-jun merged 7 commits into
devfrom
codex/vision-routed-sidecar

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds the "routed" vision-sidecar backend (#2188 roadmap 160-190, revised): any picker-visible, non-provably-text-only provider row can describe images. The describer dispatches through the proxy's own /v1/chat/completions on loopback, so every provider wire the router speaks (xai, Antigravity, volcengine, cursor, zenmux, ...) is a valid describer with ONE executor. Options carry namespaced provider/model values; the provably-blind write gate widens to all vendor families and learns namespaced ids; PUT coherence rejects namespaced-with-legacy-backend and bare-with-routed. Recursion fence: the loopback describe carries x-opencodex-vision-describe, detected at the chat surface and honored at the Responses plan site (depth cap 1); the native chat fast path defers image-bearing text-only-model requests to the Responses pipeline. GUI splits VisionBackend from the legacy pair and infers routed for namespaced values; CLI list/usage updated; GET reports a routed describer verbatim.

Design + 4-round adversarial audit recorded in devlog/_plan/260820_sidecar_selection_unification/160-190.

Verification

  • bun run typecheck clean (root + gui); bun run lint:gui clean; bun run privacy:scan green.
  • Full suite at final head: 14171 pass / 0 fail (891 files).
  • New tests: tests/vision-backend-union.test.ts (9), tests/vision-routed.test.ts (5, incl. full chat-surface recursion-fence regression and loopback e2e).
  • Live proof on a dev server (copied auth home, port 11100): GET visionModels = 25 rows incl. 17 namespaced [routed]; PUT routed+xai/grok-4.6 200, routed+xai/grok-3 400 provably-blind, openai+namespaced 400 coherence; ocx agent sidecar vision --list parity; dashboard dropdown screenshot shows routed rows; live e2e describe: 64x64 red PNG to xai/grok-composer-2.5-fast (noVisionModels) answered "red" via the grok-4.6 routed describer.

Checklist

  • Focused regression tests added near the affected subsystems
  • bun run typecheck / bun run test green at head
  • privacy:scan green
  • Docs: devlog unit updated (160-190); user-facing docs-site follow-up not required for this internal picker surface (GUI strings unchanged)

Screenshot

vision routed dropdown

Summary by CodeRabbit

  • New Features

    • Added the Routed vision backend for image-capable models from additional providers.
    • Routed models now appear with provider/model identifiers in vision selections.
    • Added routed image descriptions through the local chat-completions service.
    • GUI and CLI configuration now support routed vision models.
  • Bug Fixes

    • Improved validation for backend and model combinations.
    • Prevented recursive vision requests and protected text-only models from receiving images.
    • Added safer handling for timeouts, invalid images, oversized responses, and redacted errors.

…ds (#2188 roadmap 170)

Any picker-visible, non-provably-text-only provider row can now be offered
as the vision describer through the new 'routed' backend. Adds the
VISION_BACKENDS descriptor table, namespaced routed option values, the
four-family + namespaced provably-blind probe, PUT coherence rules
(namespaced <-> routed), and claude-code override parity. Docs 170/180
revised with three audit rounds folded in.
…roadmap 180)

The routed backend describes images by POSTing the proxy's own
/v1/chat/completions with the namespaced describer model, so every provider
wire the router speaks is a valid describer. Recursion fence: the request
carries x-opencodex-vision-describe, detected at the chat surface (bridge
rebuilds headers) and honored at the Responses plan site — marked requests
strip instead of describing (depth cap 1). Native chat fast path now defers
image-bearing text-only-model requests to the Responses pipeline so vision
coverage is symmetric. Admission ladder: env token, service token file,
first apiKeys entry, sent as x-opencodex-api-key.
…ber verbatim

Splits VisionBackend from the legacy SidecarBackend pair (web-search keeps
its own union), infers routed for namespaced values in the GUI fallback so a
working describer is never rewritten on save, widens the claude-code
override select, updates the CLI usage line, and makes GET report a routed
backend's namespaced model instead of collapsing to the legacy default.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 21, 2026 16:45
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 21, 2026
@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 8632f32c-dd51-49c6-8228-2cbeb2ed33b9

📥 Commits

Reviewing files that changed from the base of the PR and between c0cbe49 and a228ed7.

⛔ Files ignored due to path filters (1)
  • devlog/_plan/260820_sidecar_selection_unification/assets/vision_routed_dropdown.png is excluded by !**/*.png
📒 Files selected for processing (23)
  • devlog/_plan/260820_sidecar_selection_unification/160_vision_external_research.md
  • devlog/_plan/260820_sidecar_selection_unification/170_vision_backend_union.md
  • devlog/_plan/260820_sidecar_selection_unification/180_vision_describe_executors.md
  • devlog/_plan/260820_sidecar_selection_unification/190_vision_surfaces_and_delivery.md
  • gui/src/pages/claude-code-sidecar.ts
  • gui/src/pages/claude-manual-env.ts
  • gui/src/pages/dashboard-shared.ts
  • gui/src/pages/use-dashboard-data.ts
  • src/cli/agent.ts
  • src/server/chat-completions.ts
  • src/server/chat-native.ts
  • src/server/management/agent-settings-routes.ts
  • src/server/management/config-routes.ts
  • src/server/management/vision-sidecar-options.ts
  • src/server/responses/core.ts
  • src/types/config.ts
  • src/vision/backends.ts
  • src/vision/eligibility.ts
  • src/vision/index.ts
  • src/vision/routed-describe.ts
  • tests/vision-backend-union.test.ts
  • tests/vision-eligibility.test.ts
  • tests/vision-routed.test.ts

📝 Walkthrough

Walkthrough

The vision sidecar now supports a routed backend with namespaced provider/model selection. The change adds backend descriptors, management validation, GUI and CLI propagation, loopback image description, recursion protection, and focused tests.

Changes

Unified vision routing

Layer / File(s) Summary
Backend contracts and eligibility
devlog/_plan/260820_sidecar_selection_unification/*, src/vision/backends.ts, src/vision/eligibility.ts, src/types/config.ts
Defines OpenAI, Anthropic, and routed backend descriptors. Routed candidates use provider/model values. OpenAI and Anthropic remain universal baseline backends.
Management and selection surfaces
src/server/management/..., gui/src/pages/..., src/cli/agent.ts
Accepts and persists routed backend/model pairs. GUI resolution preserves server provenance and infers routed handling for namespaced models. Web-search handling excludes the routed backend.
Routed description runtime
src/vision/index.ts, src/vision/routed-describe.ts, src/server/chat-native.ts, src/server/chat-completions.ts, src/server/responses/core.ts
Plans routed descriptions for image-capable namespaced models. Sends validated multimodal requests through loopback chat completions with authentication, timeout, cancellation, response validation, redaction, and terminal recursion markers.
Runtime validation and delivery evidence
tests/vision-backend-union.test.ts, tests/vision-eligibility.test.ts, tests/vision-routed.test.ts, devlog/_plan/260820_sidecar_selection_unification/190_vision_surfaces_and_delivery.md
Covers backend activation, eligibility, blindness checks, management gates, persistence, request wiring, authentication precedence, recursion prevention, error redaction, and end-to-end caption delivery.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ResponsesCore
  participant VisionIndex
  participant RoutedDescribe
  participant ChatCompletions
  participant TextOnlyModel
  Client->>ResponsesCore: Send image request
  ResponsesCore->>VisionIndex: Plan routed vision description
  VisionIndex->>RoutedDescribe: Describe image with provider/model
  RoutedDescribe->>ChatCompletions: Send terminal multimodal request
  ChatCompletions->>ResponsesCore: Propagate terminal marker
  ResponsesCore->>TextOnlyModel: Forward caption without image
  TextOnlyModel-->>RoutedDescribe: Return description text
  RoutedDescribe-->>ResponsesCore: Provide extracted caption
Loading

Suggested reviewers: ingwannu

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/vision-routed-sidecar

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

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed.

Hygiene

✅ Deterministic PR hygiene checks passed.

@github-actions
github-actions Bot marked this pull request as draft August 21, 2026 16:45
@lidge-jun
lidge-jun marked this pull request as ready for review August 21, 2026 16:45
@lidge-jun
lidge-jun merged commit 401c24f into dev Aug 21, 2026
7 of 11 checks passed
@lidge-jun
lidge-jun deleted the codex/vision-routed-sidecar branch August 22, 2026 13:58
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…sidecar

feat(vision): routed describer backend — any picker-visible image-capable model (lidge-jun#2188)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant