Repository navigation
Description
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:
- OpenRouter's
GET /api/v1/modelsincludesalias_target: { slug, name }on each alias. - OpenCode's
model.listdrops it. Its entries carry onlyfamily,time.released, andstatus. models.dev has acanonical_model_idfield for some providers, but not for OpenRouter aliases, and OpenCode doesn't pass that field through either. I've asked for both upstream: openrouter:~…-latestaliases have nocanonical_model_id, so consumers can't tell which model an alias currently serves anomalyco/models.dev#14055 (link aliases to their targets) and [FEATURE]: include models.dev'scanonical_model_idinmodel.listanomalyco/opencode#64845 (passcanonical_model_idthroughmodel.list).
Possible fixes, from smallest to most complete:
- Never mark an alias legacy by date. Recognize aliases by a
~prefix or a-latestsuffix, leave them out when computing each family's newest release, and mark them legacy only when they'redeprecated. This misses stuck aliases likegpt-mini-latest, but that is what happens today anyway. - 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_idor from OpenRouter'salias_target. - Detecting abandoned lines like
gpt-miniwould 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
- Enable the OpenCode provider (OpenCode 2.3.2) with OpenRouter connected.
- Open the model picker and go to the OpenCode tab.
GPT Astra LatestandDeepSeek Flash Latestare listed only after "Show more". - Optional check:
opencode api model.listshows~openai/gpt-astra-latestwithfamily: "gpt-astra"andtime.released2026-09-10, next toopenai/gpt-6.2-astrawith 2026-11-17.curl https://openrouter.ai/api/v1/modelsshows the alias'salias_targetisopenai/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
- OpenCode models from different classes in one
familymark each other legacy (Gemini 4 Carbon hidden by Gemini 4 Hydrogen) #37249: the same function misclassifies models when onefamilyspans several model classes. - [Bug]: Model picker "Find a model" search cannot surface legacy models (filtered out before the query runs) #27573: legacy models can't be found through picker search.
- openrouter:
~…-latestaliases have nocanonical_model_id, so consumers can't tell which model an alias currently serves anomalyco/models.dev#14055 and [FEATURE]: include models.dev'scanonical_model_idinmodel.listanomalyco/opencode#64845: the upstream data T3 would need to resolve aliases properly (fix 2).
Fix applied or workaround
Favoriting an alias keeps it out of the collapsed legacy section. It's still skipped for default-model selection.
Activity