Skip to content

[Bug]: Combo inputModalities strict intersection strips vision capability across clients & missing dsh sync target #8312

Closed

Description

@oya254

Client or integration

Other (DeepSeek Harness, Droid, Raycast, Claude Code, OpenCode, Qoder)

Area

Catalog / models

Summary

There is a fundamental architectural disconnect in OpenCodex's core Combo system (src/codex/catalog/aggregation.ts):
When a combo combines both text-only models (e.g. DeepSeek V4.1 Flash) and vision-capable models (e.g. Gemini 3.8 Flash, Claude Sonnet) for failover/load-balancing, OpenCodex derives the combo's catalog metadata by taking a strict intersection of input modalities.

This causes the entire combo to be declared as input_modalities: ["text"], artificially stripping vision capability from all downstream client apps (DeepSeek Harness, Droid, Raycast, OpenCode, Qoder, Claude Code, etc.), even though OpenCodex's runtime proxy already supports multimodal failover perfectly.

Additionally, client ID "dsh" is omitted from the default target arrays in src/integrations/catalog-refresh.ts and src/cli/sync-command.ts.

Reproduction

  1. Configure a failover combo in ~/.opencodex/config.json containing a vision target and text-only targets (e.g., google-antigravity/gemini-3.8-flash + river/deepseek-v4.1-flash).
  2. Run ocx sync.
  3. Inspect the derived catalog or connect any client (e.g., DeepSeek Harness or Droid).
  4. Observe that the combo is marked with input_modalities: ["text"] only.
  5. In client UIs (e.g., DeepSeek Harness), trying to attach an image immediately blocks user submission with "The current model does not support images; switch to a model that does".
  6. Yet, sending the exact same image request directly to OpenCodex proxy (/v1/chat/completions) succeeds with HTTP 200 OK because proxy failover correctly routes images to the vision target.

Root Cause

In src/codex/catalog/aggregation.ts (deriveComboCatalogModel):

const derivedInputModalities = intersectStrings(
  members.map(member => member.inputModalities ?? ["text"]),
);
const inputModalities = combo.imageInput === "disabled"
  ? derivedInputModalities.filter(modality => modality !== "image")
  : derivedInputModalities;

Because intersectStrings requires 100% of member targets to declare image, any combo configured for speed with multimodal fallback has its image modality dropped completely.

In addition:

  • src/integrations/catalog-refresh.ts:15 (clientIds array) and src/cli/sync-command.ts:175 omit "dsh" from the auto-refresh targets.

Suggested Fix

  1. In src/codex/catalog/aggregation.ts, if combo.imageInput !== "disabled" and any member target supports image, allow the combo to inherit the image modality:
const hasVisionMember = members.some(m => m.inputModalities?.includes("image"));
const derivedInputModalities = intersectStrings(
  members.map(member => member.inputModalities ?? ["text"]),
);
let inputModalities = combo.imageInput === "disabled"
  ? derivedInputModalities.filter(modality => modality !== "image")
  : derivedInputModalities;

if (combo.imageInput !== "disabled" && hasVisionMember && !inputModalities.includes("image")) {
  inputModalities = [...inputModalities, "image"];
}
  1. In src/integrations/catalog-refresh.ts and src/cli/sync-command.ts, append "dsh" to the client ID refresh arrays.

Version

2.67.x

Operating system

macOS (Apple Silicon)

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    catalog
    on Nov 7, 2026
  2. Ingwannu commented on Nov 8, 2026

    @Ingwannu
    Owner

    Checked against dev (f8dfc2f). The strict intersection is the documented default, not a code bug:

    • src/codex/catalog/aggregation.ts:75-79 and :130-135 implement the intersection.
    • docs-site/src/content/docs/guides/combos.md, section "Image / multimodal capability", documents it: image is enabled only when every target advertises it.

    The documented way to get images through a mixed combo is the Vision Sidecar. The dashboard's Image / multimodal switch enrolls the text-only members by writing inputModalities: ["text"] on them, so the sidecar describes images before the main call. Could you enable that switch on your combo and check whether the client still blocks the image? If it does, please send the redacted combo definition and the catalog row for the combo.

    Advertising image input whenever any target is text-only would let clients send images to a target that cannot accept them. The sidecar exists for that case, so changing the default is a design decision for the owner, not a bug fix.

    On dsh: it is missing from the refresh lists in src/integrations/catalog-refresh.ts:15 and src/cli/sync-command.ts:175, and it has never been in them, so this is not a regression. Whether DSH should be refreshed automatically is a separate decision, because DSH edits its profile patch under its own lock.

  3. oya254 commented on Nov 8, 2026

    @oya254
    Author

    Thank you for the quick triage and for clarifying the design rationale behind intersectStrings and the Vision Sidecar!

    1. Vision Sidecar vs. Native Multimodal Failover

    The Vision Sidecar is a great feature for enabling text-only targets to comprehend images via OCR / description preprocessing.

    However, there is an important distinction between Sidecar Preprocessing and Native Multimodal Failover:

    • When configuring a failover combo where primary targets are fast text-only models (e.g., river/deepseek-v4.1-flash) and fallback targets are native vision models (e.g., gemini-3.8-flash or claude-sonnet), the intent for multimodal queries (like complex UI screenshots, diagram interpretation, or spatial reasoning) is often for the native vision model to evaluate the raw image tokens directly.
    • The Vision Sidecar converts the image into text descriptions before sending it to the text model, which loses spatial reasoning and introduces extra latency/cost compared to direct native vision inference.

    2. Runtime Proxy Already Anticipates Multimodal Hops

    What is notable about OpenCodex's design is that the runtime proxy engine already has explicit support for multimodal hopping!

    In src/combos/failover.ts (lines 862–867):

    // The input-modality refusal is the same kind of verdict: this route cannot read the turn's
    // media, and a later target may. Its 400 would otherwise end the chain as invalid_request_error.
    if (["model_not_found", "model_unavailable", "unsupported_model", "unsupported_input_modality"].includes(failureCode)) {
      return "hop";
    }

    And lines 489–492:

    // A route that cannot read the request's media (image input to a text-only CLI route) is
    // healthy for every other request, so cooling it would only block unrelated turns.
    "unsupported_input_modality",

    The runtime proxy already recognizes unsupported_input_modality as a request-local target incompatibility that hops to the next candidate without cooling the route. If an image request reaches the proxy, it handles it gracefully!

    3. The Core Issue: Client-Side Catalog Gatekeeping

    The disconnect happens because client apps (DeepSeek Harness, Raycast, Droid, OpenCode, Claude Code, etc.) inspect the advertised catalog (input_modalities) client-side before dispatching:

    • Because aggregation.ts takes a strict intersection, the combo advertises input_modalities: ["text"].
    • Downstream client UIs disable the attachment button or immediately throw "The current model does not support images", aborting the request locally before it ever reaches OpenCodex.

    4. Proposed Backwards-Compatible Solution

    To respect the existing design and avoid breaking users who rely on strict intersection, would you consider allowing an explicit opt-in on the combo configuration?

    For example, extending combo.imageInput:

    • imageInput: "intersect" (default — keeps existing behavior / documentation intact)
    • imageInput: "union" (or "native-failover" — advertises image if any target has vision, allowing client apps to send images and letting failover.ts:865 hop to the vision target)
    • imageInput: "disabled" (existing — explicitly drops vision)

    In src/codex/catalog/aggregation.ts:

    const derivedInputModalities = intersectStrings(
      members.map(member => member.inputModalities ?? ["text"]),
    );
    
    let inputModalities = derivedInputModalities;
    
    if (combo.imageInput === "disabled") {
      inputModalities = inputModalities.filter(m => m !== "image");
    } else if (combo.imageInput === "union") {
      const hasVisionMember = members.some(m => m.inputModalities?.includes("image"));
      if (hasVisionMember && !inputModalities.includes("image")) {
        inputModalities = [...inputModalities, "image"];
      }
    }

    This keeps the default 100% safe and adheres to the docs, while unlocking native multimodal failover for mixed combos without requiring the sidecar.


    5. Regarding DSH & Profile Lock

    Understood on the DSH profile lock considerations. DSH writes its profile patch under its own lock, so an unconditional file write in catalog-refresh.ts could indeed risk lock contention.

    Perhaps a safe non-intrusive approach could be:

    • Adding a lock-check guard before touching DSH's cordis.patch.yml, or
    • Keeping it behind an explicit opt-in flag / client subcommand (e.g., ocx integration client sync dsh).

    Happy to submit a clean PR for the imageInput: "union" option if you are open to this design direction!

  4. lidge-jun commented on Nov 19, 2026

    @lidge-jun
    Owner

    Both halves have landed: #8910 (DeepSeek Harness catalog refresh, 270161a) and #8651 (union capability policy incl. vision, 51775ce).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcatalog

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions