Repository navigation
Description
What happened
OpenCode Free (the zero-credential default) is largely broken because its free-model set is a hardcoded pin that has rotted, and new free models never reach users.
The pin lives in packages/core/src/provider-registry.ts:604-609 (opencodeFreeModelIds) and the default enabled set at packages/core/src/provider-registry.ts:8-13:
- pinned:
nemotron-3-ultra-free,mimo-v2.5-free,big-pickle,deepseek-v4-flash-free - default enabled:
nemotron-3-ultra-free,mimo-v2.5-free,deepseek-v4-flash-free
Live probes against https://opencode.ai/zen/v1/chat/completions (anonymous, 2026-08-21):
| model | result |
|---|---|
nemotron-3-ultra-free |
200 OK |
mimo-v2.5-free |
429 FreeUsageLimitError — "Rate limit exceeded. Please try again later." |
big-pickle |
429 FreeUsageLimitError — same |
deepseek-v4-flash-free |
400 server_error — "Upstream request failed: Model is unavailable." |
So 3 of the 4 pinned models are dead: users get stuck in Error: Rate limit exceeded loops, and the TUI even logs confusing notices like Model changed: mimo-v2.5-free → mimo-v2.5-free when re-electing within the stale set.
At the same time, the free catalog upstream has moved on. models.dev currently lists ~29 free opencode models; several work anonymously today but are absent from the pin, e.g.:
x-preview-f-free— displayed as "Ox Alpha Free (Unlimited)", tool-capable, answers 200 anonymouslylaguna-s-2.1-free— 200nemotron-3.5-lightning-free— 200
Because the pin is as const, none of these ever appear in the model picker until someone edits the list by hand. The repo's own generated snapshot lags too: as of today's refresh (#3324) model-metadata.generated.ts still has no x-preview-f-free.
One more wrinkle for whoever fixes this: the anonymous-served set is strictly smaller than the models.dev free set. Many snapshot-listed free ids (glm-5-free, kimi-k2.5-free, grok-code, minimax-m3-free, …) answer 401 ModelError: Model … is not supported anonymously, so deriving the free list from cost.input === 0 alone would over-offer. Validation needs to hit the live endpoint (or at least treat 401 ModelError as "not anonymously served").
Suggested directions (maintainer's call):
- stop hardcoding the free set; derive candidates from the models.dev snapshot and health-check them (the
testConnectionfallback-probe machinery already does most of this) - or keep a pin but add a scheduled check that fails CI/lint when a pinned id stops answering 200 anonymously
- treat 429
FreeUsageLimitError/ 400 "Model is unavailable" as rotation signals so a dead enabled model doesn't trap the session
How to reproduce
- Start Maka fresh with no credentials — the bootstrap seeds the
opencode-freeconnection with enabled models[nemotron-3-ultra-free, mimo-v2.5-free, deepseek-v4-flash-free](packages/runtime-host/src/server/bootstrap-runtime-policy.ts:76-83). - Switch the model to
mimo-v2.5-free(or exhaust the per-IP quota on the default), then send any message. - Turn fails with
Error: Rate limit exceeded; pickingdeepseek-v4-flash-freefails because the model is unavailable upstream;big-pickleis likewise 429. - Open the model picker on the OpenCode Free connection — only the stale four are offered; none of the newly added free models (e.g. Ox Alpha Free) exist.
Direct curl equivalent:
curl -s https://opencode.ai/zen/v1/chat/completions \
-H 'content-type: application/json' \
-d '{"model":"mimo-v2.5-free","messages":[{"role":"user","content":"hi"}],"max_tokens":1}'
# {"type":"error","error":{"type":"FreeUsageLimitError","message":"… Rate limit exceeded …"}}Environment
- Maka version or commit:
57e08d834(main, 2026-08-21) - OS and version: Linux
- Surface: all surfaces that use the
opencode-freeconnection (Desktop / TUI / CLI) - Node.js version, if running from source: 22.x
Logs, screenshots, or additional context
- This is the same failure class as fix(opencode-free): replace unhealthy big-pickle bootstrap default #2165, which swapped one unhealthy pinned default (
big-pickle) for another; the pin has rotted again since. A one-off swap will keep recurring. - Related: Fallback model lists still offer deprecated models for six providers #3355 (fallback lists offering retired models), Persisted connection catalogs keep model ids that the snapshot has retired #3354 (persisted catalogs keeping retired ids).
- Probe summary (anonymous, 2026-08-21): working —
nemotron-3-ultra-free,x-preview-f-free,laguna-s-2.1-free,nemotron-3.5-lightning-free; rate-limited —mimo-v2.5-free,big-pickle; unavailable —deepseek-v4-flash-free; not anonymously served (401 ModelError) — most other-freeids in the snapshot.
Diagnosis and endpoint probes above were prepared with assistance from an AI coding agent (opencode); the reporter verified the results.
Activity
cunninghamcard-bit commentedon Aug 21, 2026
I would like to help
me2seeks commentedon Aug 21, 2026
Update: the free tier is shrinking in real time, which makes the pin rot faster than any manual swap can track.
Same-day snapshot diff (models.dev, 2026-08-21):
deepseek-v4-flash-free— nowlifecycle: 'deprecated'(matches the 400 "Model is unavailable" probe above)laguna-s-2.1-free— nowlifecycle: 'deprecated'too (it answered 200 this morning)x-preview-f-free("Ox Alpha Free (Unlimited)")A minimal un-pinned design exists and is prototyped locally:
scripts/sync-model-metadata.mjsemits anisFree: truemarker when models.dev prices a model at zero input cost (one-line change; the generator already parsescost).opencodeFreeModelIds/OPENCODE_FREE_DEFAULT_ENABLED_MODELSbecome a derivation over that marker (isFree && functionCalling && !deprecated, default model first) instead of a hardcoded list. A module-load guard fails loudly if the snapshot ever loses the default.testConnectionfallback probing already skips unhealthy candidates, and new/retired free models now flow through the routine snapshot refresh (chore: refresh the models.dev catalog snapshot #3324-style chores).With this, today's prune lands automatically on the next refresh: deprecated ids drop out,
x-preview-f-freeappears, and fresh installs no longer seed dead defaults.Follow-up analysis prepared with the same AI agent assistance disclosed in the issue body.
shaokeyibb commentedon Aug 21, 2026
Maybe consider read
https://opencode.ai/zen/go/v1/modelsto get a full list of opencode models, tag the free model when the suffix end withFree?me2seeks commentedon Aug 21, 2026
Thanks for the suggestion — the live
/modelsidea is directionally right and worth recording, but two corrections from probing the endpoints today:1. Wrong endpoint for the free tier.
https://opencode.ai/zen/go/v1/modelsis the OpenCode Go (paid plan) catalog — it returnsminimax-m3,kimi-k3, etc., essentially no free models. The anonymous free tier lives onhttps://opencode.ai/zen/v1/models, which does work without credentials (64 ids today, free subset matches the derived set exactly).2. A "Free" suffix rule is not a reliable tag. Current counter-examples from the live catalog:
big-picklex-preview-f-freeDisplay names are not a contract. models.dev's
cost.input === 0is structured, authoritative, and already flows through our sync pipeline (scripts/sync-model-metadata.mjsparsescostfor pricing), so the prototyped fix derives the free set from that marker plusfunctionCallingandlifecycle !== 'deprecated'.One more caveat if you pursue discovery: the served
/zen/v1/modelslist is not a health filter either — today it still listsdeepseek-v4-flash-freeandlaguna-s-2.1-free, both deprecated and returning errors. Lifecycle filtering stays necessary regardless of source.A good future enhancement would be intersecting the snapshot-derived free set with the anonymous
zen/v1/modelslisting to also drop "declared free but not anonymously served" ids. For the minimal fix the derivation alone already resolves this issue's rot.cunninghamcard-bit commentedon Aug 21, 2026
Opened #3429 implementing the derivation approach discussed above —
isFreemarker from models.dev'scost.input === 0in the metadata sync, free set derived asisFree && functionCalling && !deprecatedwith a loud module-load guard on the default model, plus a snapshot refresh so today's prune lands immediately (deprecated ids out,x-preview-f-freein).Thanks @me2seeks for the detailed probes and the derivation design — the endpoint corrections and the "display names are not a contract" counter-examples shaped the fix directly — and @shaokeyibb for raising the live
/modelsdiscovery idea; the snapshot-vs-anonymous-listing intersection is recorded in the PR as a possible follow-up.fix(core): derive the OpenCode Free model set from the models.dev sna…
fix(core): derive the OpenCode Free model set from the models.dev sna…
fix(runtime-host): migrate untouched legacy opencode-free seeds on bo…
fix(runtime-host,storage): migrate untouched legacy opencode-free see…
fix(runtime-host,storage): migrate untouched legacy opencode-free see…
fix(core): derive the OpenCode Free model set from the models.dev sna…