Skip to content

fix(models): prefer vision-capable variant over provider order for ambiguous ids - #444

Merged
Yeachan-Heo merged 1 commit into
devfrom
feat/custom-model-does-not-supports-vision
Jun 9, 2026
Merged

fix(models): prefer vision-capable variant over provider order for ambiguous ids#444
Yeachan-Heo merged 1 commit into
devfrom
feat/custom-model-does-not-supports-vision

Conversation

@Yeachan-Heo

Copy link
Copy Markdown
Owner

Problem

A custom model that supports vision could be reported/treated as not supporting vision when referenced by a bare id.

When a models.yml declares the same model id under two providers — e.g. claude-opus-4-8 under a text-only openai-completions proxy and a vision-capable anthropic-messages proxy — resolving the bare id (model carousel, /model claude-opus-4-8, or any non-qualified reference) chose the variant purely by configured provider order. If the text-only provider was declared first, gjc resolved to the text-only namesake and treated the model as non-vision, even though a vision-capable variant of the same id was available.

Fix

Add a vision-capability preference ranked above configured provider order in both ambiguous-id resolvers:

  • ModelRegistry.#resolveCanonicalVariant (packages/coding-agent/src/config/model-registry.ts)
  • pickPreferredModel (packages/coding-agent/src/config/model-resolver.ts)

An ambiguous id now resolves to a vision-capable variant whenever one exists. Explicit provider/id qualification (e.g. layofflabs/claude-opus-4-8) is unchanged and still routes exactly as written.

Verification

  • Bare claude-opus-4-8 → vision variant (["text","image"]); explicit layofflabs/claude-opus-4-8 → still text-only.
  • Updated the provider-order canonical test to use equal-capability variants (provider order remains the tiebreak when capabilities match).
  • Added a test asserting vision wins over configured provider order.
  • model-registry.test.ts and model-resolver.test.ts pass; biome clean on changed files.

…biguous ids

When a bare model id (e.g. claude-opus-4-8) matches both a text-only and a
vision-capable provider variant, resolution picked the variant purely by
configured provider order, so gjc could resolve a vision-capable model to its
text-only namesake and treat it as non-vision.

Add a vision-capability preference ranked above provider order in both
ambiguous-id resolvers (ModelRegistry.#resolveCanonicalVariant and
pickPreferredModel). Explicit provider/id qualification is unchanged.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Yeachan-Heo
Yeachan-Heo merged commit e4371a2 into dev Jun 9, 2026
2 checks passed
@Yeachan-Heo
Yeachan-Heo deleted the feat/custom-model-does-not-supports-vision branch June 9, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant