Skip to content

[Bug] Custom-provider vision capability is ambiguous when model metadata is missing #1024

Description

@brunoflma

Client or integration

Direct HTTP/API client through the OpenCodex proxy (/v1/responses, /v1/models).

Area

Proxy and routing · Catalog / models · Vision sidecar · Custom providers

Summary

This issue now tracks only the remaining TokenRouter case:

TR/moonshotai/kimi-k3-free

The previously reported OpenCode Zen vision cases were investigated and resolved by #1070. That PR classified the Zen models individually, including confirming that mimo-v2.5-free is natively vision-capable and that nemotron-3-ultra-free is text-only and should use the vision fallback.

The remaining failure is different because TR is a custom TokenRouter provider in the reporter configuration rather than a built-in OpenCodex registry provider. OpenCodex therefore has no canonical registry metadata from which to determine whether moonshotai/kimi-k3-free supports image input or requires the vision sidecar.

In the reporter's configuration, the model returns HTTP 200 but does not correctly identify a deterministic image, while another model on the same TokenRouter provider succeeds with the same request.

Reproduction

  1. Configure the custom TR provider for TokenRouter.

  2. Start OpenCodex.

  3. Send a /v1/responses request using:

    TR/moonshotai/kimi-k3-free

  4. Include a 16×16 opaque red PNG as the only input_image.

  5. Ask the model to identify the dominant color.

  6. Observe that the request returns HTTP 200 but does not correctly answer RED.

  7. Repeat the same request with:

    TR/qwen/qwen3.8-max

  8. Observe that the control model correctly processes the same image.

Version

Originally reproduced on @bitkyc08/opencodex 2.10.0.

The OpenCode Zen portion of the original report has since been resolved on dev by #1070. This issue remains open only for the custom TokenRouter route.

Operating system

Windows 11, using the Codex runtime through the local OpenCodex proxy.

The remaining behavior is expected to be provider/routing-specific rather than Windows-specific.

Provider and model

Custom provider:

TR → TokenRouter

Remaining affected model:

moonshotai/kimi-k3-free

Known working control on the same custom provider:

qwen/qwen3.8-max

Remaining problem

Custom-provider model rows do not necessarily carry authoritative modality metadata.

For a built-in provider, OpenCodex can maintain model-specific capability information such as:

  • native image-input support;
  • known text-only models;
  • vision-sidecar requirements.

For a custom provider such as TR, OpenCodex cannot safely infer those properties from the provider name or model lineage alone.

The remaining question is therefore not whether the already-fixed Zen classifications should be expanded. It is how OpenCodex should handle missing or uncertain image capability metadata for custom-provider models without either:

  • sending images directly to a text-only upstream, or
  • unnecessarily replacing native image input with a sidecar for a model that actually supports vision.

Expected behavior

OpenCodex should have a deterministic policy for custom-provider models whose image-input capability is unknown.

A valid solution could include one or more of:

  • preserving authoritative modality metadata returned by the custom provider's model catalog;
  • allowing explicit per-model inputModalities / vision capability configuration;
  • allowing explicit per-model vision-sidecar classification for custom providers;
  • exposing unknown modality state clearly rather than treating unknown as proven vision support;
  • ensuring the runtime and /v1/models expose the same effective capability decision.

The implementation must not globally classify models by name or vendor lineage when the actual custom endpoint may expose different capabilities.

Acceptance criteria

  • TR/moonshotai/kimi-k3-free receives deterministic image handling based on actual or explicitly configured capability evidence.
  • A custom-provider model with confirmed native vision support continues receiving the original image directly.
  • A custom-provider model explicitly classified as text-only uses the vision fallback rather than receiving unsupported image content.
  • Unknown capability is not silently converted into false capability certainty.
  • /v1/models and request-time routing agree on the model's effective image capability.
  • Regression coverage includes at least:
    • one custom-provider text-only model;
    • one custom-provider native-vision model;
    • one custom-provider model with unknown capability.

Resolved portions of the original report

Those cases should not be considered acceptance criteria for this issue anymore.

Cross-references

Checks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions