GeezerVison is showing github.com — github-copilot: Copilot Free accounts expose no models in /models (enabled mapped from model_picker_enabled) · Issue #56355 · anomalyco/opencode
github-copilot: Copilot Free accounts expose no models in /models (enabled mapped from model_picker_enabled) #56355DescriptionSummary
With a GitHub Copilot Free account, the connected github-copilot provider exposes zero models, so /models shows nothing for it. As soon as the account model sync runs, every discovered model is created with enabled: false (OpenCode maps GitHub's model_picker_enabled, which is false for every model on Free plans), and the selector only lists enabled models.
Environment
- opencode version: 2.0.31
- OS: Darwin 25.6.0 (darwin arm64,
root:xnu-12377.161.14~5/RELEASE_ARM64_T8103)
- Terminal: Warp (
TERM_PROGRAM=WarpTerminal, TERM=xterm-256color, COLORTERM=truecolor)
- Shell:
/bin/bash
- Install/channel: latest release (
~/.opencode/bin/opencode)
- Active plugins: none
Reproduction
- Connect a GitHub account on the Copilot Free plan:
opencode auth login github-copilot (device flow). Account reports copilot_plan: individual, access_type_sku: free_limited_copilot, chat_enabled: true.
- Start a private server for a directory:
opencode serve --port 4097 (or opencode --standalone).
GET /api/model right after startup returns 38 github-copilot/* models (models.dev catalog).
POST /api/location/reload (or simply wait for the account sync to apply): GET /api/model then returns 0 github-copilot/* models.
opencode models against the shared service lists no github-copilot/* entry either.
Expected Behavior
The models the account can actually use — GitHub returns policy.state: "enabled" for gpt-4.1, gpt-5-mini, claude-haiku-4.5, gpt-5.6-luna, gpt-6-luna, mai-code-1.1-flash on this account — should be listed in /models.
Actual Behavior
After the sync, GET /api/provider/github-copilot still reports the provider as activation: enabled and the connection is intact, but its model list is empty and /models has nothing to select.
GET https://api.individual.githubcopilot.com/models for this account returns 52 entries, and all of them have model_picker_enabled: false, including the entries whose policy.state is "enabled". OpenCode maps that field directly to the model's enabled flag (enabled: a.model_picker_enabled in the github-copilot provider plugin), and the model selector only shows enabled models, so the whole provider ends up empty.
Additional Context
- The credential and entitlement are fine:
GET https://api.github.com/copilot_internal/user returns 200 with chat_enabled: true, copilot_plan: "individual", access_type_sku: "free_limited_copilot", endpoints.api: "https://api.individual.githubcopilot.com".
- Restarting the background service does not help, and neither does
--standalone: it is not stale state. The empty list is produced whenever the sync result is applied.
- The log also contains an earlier transient sync failure, which is unrelated but explains why some sessions keep the raw catalog list:
WARN failed to sync GitHub Copilot models cause="TypeError: getaddrinfo ENOTFOUND api.individual.githubcopilot.com"
- Workaround that works (so the account and endpoint are fine): a custom OpenAI-compatible provider pointed at
https://api.individual.githubcopilot.com with the Copilot token serves gpt-4.1 correctly, including through opencode run --model copilot/gpt-4.1.
- Suggestion: compute
enabled from policy.state === "enabled" as well (for example model_picker_enabled || policy.state === "enabled"), so Copilot Free accounts list the models they are allowed to call. Note policy.state is also absent on many entries, so only "disabled" should be treated as unavailable.
Activityopencode-agent commented on Oct 17, 2026 Thanks for the detailed report. I was able to reproduce this with a mock of the Copilot /models endpoint. I don't have a real Copilot Free account, so I took the API response from your report.
What I did:
- Started
opencode serve and saved a github-copilot OAuth credential pointing at the mock.
- The mock returns
gpt-4.1, gpt-5-mini and claude-haiku-4.5 with policy.state: "enabled", all with model_picker_enabled: false.
- Reloaded, then counted the Copilot models in
GET /api/model.
Results:
- The sync runs (the mock receives the
GET /models request), but 0 github-copilot/* models are listed.
- With the same mock set to
model_picker_enabled: true, all three models show up.
- This happens on 2.0.31 and still on the latest
dev (22e771f). It comes from enabled: remote.model_picker_enabled in the Copilot model sync.
The script below reproduces it (PICKER=1 runs the control case).
One thing for whoever picks this up: an earlier v2 comment in #42083 says some models that GitHub marks policy.state: "enabled" (e.g. gpt-5-mini, claude-haiku-4.5) still returned model_not_supported on a Free account. Only the gpt-4.1/gpt-4o models worked. So enabling every model with policy.state: "enabled" might list some that can't actually be called.
Related: #42083 (same root cause, originally reported against v1), #52983 (Copilot models missing or unusable on v2).
Reproduction script (repro.sh)
#!/usr/bin/env bash
# Repro for #56355: Copilot models with model_picker_enabled:false (as on Copilot Free) end up hidden.
# Usage: OPENCODE="opencode" bash repro.sh (or OPENCODE="bun ... packages/cli/src/index.ts")
# PICKER=1 bash repro.sh is the control: same mock with model_picker_enabled:true lists the models.
set -u
OPENCODE=${OPENCODE:-opencode}
W=$(mktemp -d); export HOME=$W/home XDG_CONFIG_HOME=$W/config XDG_DATA_HOME=$W/data XDG_STATE_HOME=$W/state XDG_CACHE_HOME=$W/cache
mkdir -p $HOME $W/proj; cd $W/proj
# Mock Copilot API (stands in for api.individual.githubcopilot.com on a Free plan):
# every model has model_picker_enabled:false; gpt-4.1 / gpt-5-mini have policy.state "enabled".
cat > $W/mock.ts <<'TS'
const m = (id: string, state?: string) => ({
id, name: id, version: id, model_picker_enabled: process.env.PICKER === "1",
...(state ? { policy: { state } } : {}),
supported_endpoints: ["/chat/completions"],
capabilities: { family: id, limits: { max_context_window_tokens: 128000, max_output_tokens: 16384, max_prompt_tokens: 128000 }, supports: { tool_calls: true, streaming: true } },
})
Bun.serve({ port: 4199, fetch(req) {
console.log("mock", req.method, new URL(req.url).pathname)
return Response.json({ data: [m("gpt-4.1", "enabled"), m("gpt-5-mini", "enabled"), m("claude-haiku-4.5", "enabled"), m("gpt-5.4", "disabled")] })
}})
TS
PICKER=${PICKER:-0} bun $W/mock.ts > $W/mock.log 2>&1 & MOCK=$!
OPENCODE_PASSWORD=pw $OPENCODE serve --port 4197 > $W/serve.log 2>&1 & SRV=$!
for i in $(seq 60); do curl -s -u opencode:pwf localhost:4197/api/model >/dev/null 2>&1 && break; sleep 1; done
count() { curl -s -u opencode:pw localhost:4197/api/model | bun -e 'const j=await Bun.stdin.json();const d=Array.isArray(j)?j:(j.data??j.items??Object.values(j).find(Array.isArray));const c=d.filter(m=>m.providerID==="github-copilot");console.log(c.length, JSON.stringify(c.map(m=>[m.id,m.enabled])))'; }
echo "before credential:"; count
curl -s -u opencode:pw -X POST localhost:4197/api/credential -H 'content-type: application/json' -d '{"integrationID":"github-copilot","value":{"type":"oauth","methodID":"device","refresh":"tok","access":"tok","expires":0,"metadata":{"apiEndpoint":"http://127.0.0.1:4199"}}}' >/dev/null
sleep 3; curl -s -u opencode:pw -X POST localhost:4197/api/location/reload >/dev/null; sleep 3
echo "after credential + sync:"; count
echo "provider:"; curl -s -u opencode:pw localhost:4197/api/provider/github-copilot | head -c 400; echo
echo "mock log:"; cat $W/mock.log
kill $SRV $MOCK
Run it: bash repro.sh
rgb00 commented on Oct 17, 2026 Independent confirmation on v2.0.32 (latest, Linux x86_64), Copilot Free account — same root cause as this report.
API check against the account's live catalog
GET <endpoint>/models (sync header X-GitHub-Api-Version: 2026-08-01, also retested with 2025-04-01 and the default) returns 52 models, all with model_picker_enabled: false, so the sync succeeds (HTTP 200) and nothing is logged — 27 of them pass the existing usable() predicate (policy.state != "disabled" + limits + tool_calls) but end up enabled: false and invisible in /api/model.
How many of those actually work on Free (POST /chat/completions with the stored device-flow token, same call the plugin makes at runtime)
| Result |
Models |
| 200 OK — real completion |
gpt-4o, gpt-4o-2024-11-20, gpt-4o-mini-2024-07-18, gpt-4.1-2025-04-14, copilot-search-a |
| 503 transient (upstream busy, not an entitlement error) |
exec-agent-a |
400 model_not_supported on Free |
gpt-5-mini, gpt-5.6-luna, gpt-6-luna, mai-code-1.1-flash, gpt-3.5-turbo, gpt-4 (legacy), all claude-* |
Two details worth factoring into the fix:
- Even the currently proposed
enabled = model_picker_enabled || policy.state === "enabled" would over-list on Free: gpt-5-mini, gpt-5.6-luna, gpt-6-luna and mai-code-1.1-flash are not policy: disabled on this account (so usable() passes them) but still return model_not_supported at call time. Only the gpt-4o / gpt-4.1 families and the search/agent utility models actually work.
policy.state is also absent on many entries (internal copilot-search-*, exec-agent-*), which is consistent with treating only "disabled" as unavailable.
Workaround note
A small local plugin using the public ctx.model.transform API re-enables the ^gpt-4o(-|$) / ^gpt-4.1(-|$) candidates after each catalog rebuild (transforms replay when the Copilot sync reloads the provider), and all 8 of those models become selectable and callable through the existing OAuth connection — no token handling, no restart needed. This also confirms the runtime path (Authorization with the stored refresh token) is healthy; only the enabled derivation from model_picker_enabled is wrong. opencode-agent commented on Oct 17, 2026 Closing as a duplicate of #34644.
GitHub Copilot Free and Student plans now only allow Auto model selection, so Copilot's /models returns every model with model_picker_enabled: false and OpenCode ends up listing no Copilot models. #34644 tracks adding a github-copilot/auto model for these plans; the fix is in progress in #55960.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|