Skip to content

OpenCode model catalog settles on OpenCode's startup snapshot before GitHub Copilot models load #41576

Done

Description

@wKovacs64

What happened

In Settings → Providers → OpenCode, the model list doesn't match the opencode CLI. github-copilot/gemini-4-neon, gpt-6.2-*, claude-fable-5.2 and mai-code-2 are missing. Models my Copilot subscription doesn't return (gemini-4-argon, gpt-6-astra, claude-fable-5.1) are listed. opencode models and the OpenCode TUI show the correct list.

Diagnosis

A freshly spawned opencode serve (2.3.2) answers /api/model with two lists in sequence:

  1. For about 1.5 s after its first location read, it answers with a static catalog: 28 github-copilot models, no gemini-4-neon.
  2. Then it emits model.updated and answers with the live Copilot list: 16 models, including gemini-4-neon and auto.
    On this machine the first list is OpenCode's built-in snapshot, because the fetch from models.opencode.ai is blocked by a corporate proxy (403). Not verified: whether the first list is also stale when that fetch succeeds.
    T3 Code's settleOpenCode2Catalog (packages/provider-opencode/src/server/status.ts) accepts a catalog once two reads 250 ms apart agree. The stale list stays the same for about 1.5 s, so the check settles on it after about 0.5 s.
    Every provider check (startup, manual refresh, the 5-minute recheck) starts a new managed server on a new port, and the trace shows that. Each check therefore hits the same cold window, and the picker never shows the live list. Nothing in packages/provider-opencode reacts to OpenCode's model.updated event.
    The opencode CLI doesn't hit this because it talks to a long-running opencode serve --service whose catalog loaded long ago.
    Possible fixes: during settling, wait until model.updated events stop. Or refresh the snapshot when model.updated arrives while a managed server is alive.

Steps to reproduce

  1. Linux. OpenCode 2.3.2 signed in to GitHub Copilot. models.opencode.ai unreachable (any proxy or firewall that blocks it).
  2. Run opencode models. It lists github-copilot/gemini-4-neon.
  3. In T3 Code, enable the OpenCode provider with Server URL blank (managed server). Click Refresh provider status.
  4. Open the OpenCode model list. gemini-4-neon is missing, and stale catalog models are present.
    To reproduce without T3 Code:
OPENCODE_SERVER_PASSWORD=pw opencode serve --hostname 127.0.0.1 --port 47712 &
sleep 4
# poll every 200 ms, with ?location[directory]=<url-encoded cwd>:
curl -s -u opencode:pw 'http://127.0.0.1:47712/api/model?location%5Bdirectory%5D=%2Ftmp'

Version

0.1.12-nightly.20261123.5138 (server). The code is the same on main at fa2ee19.

Environment

RHEL 9.8 remote server over SSH, T3 Code Nightly desktop on Windows, Node 26.13.1, @opencode/cli 2.3.2, OpenCode providers: github-copilot, opencode

Evidence

# Fresh `opencode serve`, /api/model polled every ~230 ms from first location read
0.48s  github-copilot models=28  gemini-4-neon=False
0.73s  github-copilot models=28  gemini-4-neon=False
0.96s  github-copilot models=28  gemini-4-neon=False
1.19s  github-copilot models=28  gemini-4-neon=False
1.42s  github-copilot models=28  gemini-4-neon=False
1.65s  github-copilot models=16  gemini-4-neon=True
# opencode.log, managed server started by T3 Code
17:29:39.973Z message="location services booted"
17:29:40.203Z level=ERROR message="Failed to fetch models.dev" cause="... 403 GET https://models.opencode.ai/experimental/v2.0/api.json?type=chat,decision,image,video"
17:29:40.395Z event.type=model.updated
# server.trace.ndjson: each checkOpenCodeProviderStatus spawns a new serve (ports 39161, 46315, 38383, 38981)
# and reads /api/provider + /api/model twice back-to-back, then stops.

Related issues

#30263 added plugin-activation retries and two-read settling. This race happens after activation succeeds, so that settling doesn't cover it. #15994 (model shown as Unavailable at startup until refresh) had a different cause: refresh fixed it there, but here refresh starts another cold server and loses the same race.

Fix applied or workaround

Workaround: point T3 Code at a long-running opencode serve (Server URL + Server password in the OpenCode provider settings). That server loads its catalog long before any T3 Code check, so /api/model returns the live Copilot list.

Filed by

pi coding agent (github-copilot/claude-opus-5.5), following .github/triage/PLAYBOOK.md. t3 triage needs Claude Code, Codex, or Antigravity, and none is installed.

Activity

  1. added
    via-triage
    on Nov 23, 2026
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

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions