Skip to content

bug(core): OpenCode Free pinned model list has rotted — 3 of 4 pinned models fail (429/400) and new free models never appear #3409

Closed

Description

@me2seeks

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 anonymously
  • laguna-s-2.1-free — 200
  • nemotron-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 testConnection fallback-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

  1. Start Maka fresh with no credentials — the bootstrap seeds the opencode-free connection 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).
  2. Switch the model to mimo-v2.5-free (or exhaust the per-IP quota on the default), then send any message.
  3. Turn fails with Error: Rate limit exceeded; picking deepseek-v4-flash-free fails because the model is unavailable upstream; big-pickle is likewise 429.
  4. 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-free connection (Desktop / TUI / CLI)
  • Node.js version, if running from source: 22.x

Logs, screenshots, or additional context

Diagnosis and endpoint probes above were prepared with assistance from an AI coding agent (opencode); the reporter verified the results.

Activity

  1. added
    bug
    help wanted
    on Aug 21, 2026
  2. cunninghamcard-bit commented on Aug 21, 2026

    @cunninghamcard-bit
    Contributor

    I would like to help

  3. me2seeks commented on Aug 21, 2026

    @me2seeks
    ContributorAuthor

    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 — now lifecycle: 'deprecated' (matches the 400 "Model is unavailable" probe above)
    • laguna-s-2.1-free — now lifecycle: 'deprecated' too (it answered 200 this morning)
    • active tool-capable free set is down to 7 ids, including x-preview-f-free ("Ox Alpha Free (Unlimited)")

    A minimal un-pinned design exists and is prototyped locally:

    1. scripts/sync-model-metadata.mjs emits an isFree: true marker when models.dev prices a model at zero input cost (one-line change; the generator already parses cost).
    2. opencodeFreeModelIds / OPENCODE_FREE_DEFAULT_ENABLED_MODELS become 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.
    3. No runtime discovery or rotation machinery needed for this fix — the existing testConnection fallback 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-free appears, and fresh installs no longer seed dead defaults.

    Follow-up analysis prepared with the same AI agent assistance disclosed in the issue body.

  4. shaokeyibb commented on Aug 21, 2026

    @shaokeyibb
    Contributor

    Maybe consider read https://opencode.ai/zen/go/v1/models to get a full list of opencode models, tag the free model when the suffix end with Free?

  5. me2seeks commented on Aug 21, 2026

    @me2seeks
    ContributorAuthor

    Thanks for the suggestion — the live /models idea 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/models is the OpenCode Go (paid plan) catalog — it returns minimax-m3, kimi-k3, etc., essentially no free models. The anonymous free tier lives on https://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:

    id displayName ends with "Free"?
    big-pickle Big Pickle no "Free" at all
    x-preview-f-free Ox Alpha Free (Unlimited) no — "(Unlimited)" suffix

    Display names are not a contract. models.dev's cost.input === 0 is structured, authoritative, and already flows through our sync pipeline (scripts/sync-model-metadata.mjs parses cost for pricing), so the prototyped fix derives the free set from that marker plus functionCalling and lifecycle !== 'deprecated'.

    One more caveat if you pursue discovery: the served /zen/v1/models list is not a health filter either — today it still lists deepseek-v4-flash-free and laguna-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/models listing to also drop "declared free but not anonymously served" ids. For the minimal fix the derivation alone already resolves this issue's rot.

  6. cunninghamcard-bit commented on Aug 21, 2026

    @cunninghamcard-bit
    Contributor

    Opened #3429 implementing the derivation approach discussed above — isFree marker from models.dev's cost.input === 0 in the metadata sync, free set derived as isFree && functionCalling && !deprecated with 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-free in).

    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 /models discovery idea; the snapshot-vs-anonymous-listing intersection is recorded in the PR as a possible follow-up.

  7. added 5 commits that reference this issue on Aug 21, 2026
    0cbaba4
    b4a1c9f
    3fdc825
    779fd2a
    4f7b72c
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

    bughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions