Skip to content

OpenRouter -latest aliases are marked legacy because their release_date is the alias's creation date, not its target's #39072

Open

Description

@Comprehensive-Jason

What happened

In the model picker's OpenCode tab, ~openai/gpt-astra-latest and ~deepseek/deepseek-flash-latest appear under the legacy models, behind "Show more". They aren't legacy. OpenRouter's aliases always route to the newest release in their line: right now ~openai/gpt-astra-latest routes to openai/gpt-6.2-astra, and ~deepseek/deepseek-flash-latest routes to deepseek/deepseek-v4.1-flash-1017.

Of the 19 OpenRouter ~…-latest aliases OpenCode lists for me, T3 marks 13 as legacy. Most of them point at their vendor's newest model.

Diagnosis

markOpenCodeLegacy (packages/provider-opencode/src/server/status.ts) groups models by ${providerID}/${family}. It marks any model whose time.released is older than the newest one in its group as superseded. An alias's time.released is the date the alias was created, and it never changes when the alias is repointed. So the first dated release in a family after the alias was created makes the alias look superseded, even though the alias now routes to that release.

OpenCode 2.3.2 model.list, providerID=openrouter:

Model family time.released T3 result Alias actually routes to
~openai/gpt-astra-latest gpt-astra 2026-09-10 legacy openai/gpt-6.2-astra (2026-11-17)
openai/gpt-6.2-astra gpt-astra 2026-11-17 current
~deepseek/deepseek-flash-latest deepseek-flash 2026-09-13 legacy deepseek/deepseek-v4.1-flash-1017 (2026-10-17)
deepseek/deepseek-v4.1-flash-1017 deepseek-flash 2026-10-17 current

The same thing happens to ~anthropic/claude-opus-latest, ~anthropic/claude-sonnet-latest, ~anthropic/claude-haiku-latest, ~anthropic/claude-fable-latest, ~google/gemini-flash-latest, ~openai/gpt-sol-latest, ~openai/gpt-terra-latest, ~openai/gpt-luna-latest, and ~x-ai/grok-latest. Every one of them routes to the newest model of its line.

This is a separate failure mode from #37249. There, family is too coarse. Here, family is right but the alias's date is meaningless for comparison. Splitting families more finely for #37249 won't fix this one.

Detecting aliases that really are stale

Some aliases do go stale. ~openai/gpt-mini-latest still routes to openai/gpt-5.4-mini (released 2026-03-17) because OpenAI stopped shipping "mini" models. T3 marks that one current, since nothing newer shares its gpt-mini family. So the current heuristic gets aliases close to backwards: it flags the ones that are up to date and misses the one that is stuck.

Doing this properly needs the alias's target, and T3 doesn't have it today:

Possible fixes, from smallest to most complete:

  1. Never mark an alias legacy by date. Recognize aliases by a ~ prefix or a -latest suffix, leave them out when computing each family's newest release, and mark them legacy only when they're deprecated. This misses stuck aliases like gpt-mini-latest, but that is what happens today anyway.
  2. When the target is known, give the alias its target's status: legacy only if the target is superseded or deprecated. That needs OpenCode to pass the target through, either from models.dev's canonical_model_id or from OpenRouter's alias_target.
  3. Detecting abandoned lines like gpt-mini would need a time-based rule, such as "the target is N months old while the vendor has shipped newer models." That's probably too noisy to be worth it.

Steps to reproduce

  1. Enable the OpenCode provider (OpenCode 2.3.2) with OpenRouter connected.
  2. Open the model picker and go to the OpenCode tab. GPT Astra Latest and DeepSeek Flash Latest are listed only after "Show more".
  3. Optional check: opencode api model.list shows ~openai/gpt-astra-latest with family: "gpt-astra" and time.released 2026-09-10, next to openai/gpt-6.2-astra with 2026-11-17. curl https://openrouter.ai/api/v1/models shows the alias's alias_target is openai/gpt-6.2-astra.

Version

T3 Code 0.1.10 (desktop server); seen in the Android app.

Environment

Windows 11 server, Android client, OpenCode 2.3.2 with the OpenRouter provider.

Related issues

Fix applied or workaround

Favoriting an alias keeps it out of the collapsed legacy section. It's still skipped for default-model selection.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions