Repository navigation
Description
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:
- For about 1.5 s after its first location read, it answers with a static catalog: 28
github-copilotmodels, nogemini-4-neon. - Then it emits
model.updatedand answers with the live Copilot list: 16 models, includinggemini-4-neonandauto.
On this machine the first list is OpenCode's built-in snapshot, because the fetch frommodels.opencode.aiis blocked by a corporate proxy (403). Not verified: whether the first list is also stale when that fetch succeeds.
T3 Code'ssettleOpenCode2Catalog(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 inpackages/provider-opencodereacts to OpenCode'smodel.updatedevent.
TheopencodeCLI doesn't hit this because it talks to a long-runningopencode serve --servicewhose catalog loaded long ago.
Possible fixes: during settling, wait untilmodel.updatedevents stop. Or refresh the snapshot whenmodel.updatedarrives while a managed server is alive.
Steps to reproduce
- Linux. OpenCode 2.3.2 signed in to GitHub Copilot.
models.opencode.aiunreachable (any proxy or firewall that blocks it). - Run
opencode models. It listsgithub-copilot/gemini-4-neon. - In T3 Code, enable the OpenCode provider with Server URL blank (managed server). Click Refresh provider status.
- Open the OpenCode model list.
gemini-4-neonis 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