fix(oauth): mark Copilot models copilot() cannot call
Merged
OK
2mo ago+43+43+01234567890123456789-4-4-0123456789
Fixes #745.
copilot()posts to/chat/completions. Copilot rejects two kinds of listed models there, and/modelsalready says which:policy.stateother thanenabled:model_not_supported("The requested model is not supported")supported_endpointswithout/chat/completions(gpt-6-luna, grok, codex, mai-code):unsupported_api_for_model
e2e models github-copilotnow marks thosenot enabledandno chat completions(packages/e2e/src/oauth/providers/github-copilot.ts). Entries without the fields (gpt-4.1, gpt-4o) stay unmarked, and they work.- Docs:
subscriptions.mdxexplains both marks;reference/cli.mdxlists them.
Out of scope: running the Responses-only models through copilot(). That needs per-model endpoint selection and @ai-sdk/openai's Responses model, like chatgpt() uses. Copilot's /responses returns 200 for gpt-6-luna, so it is doable as a follow-up.
The reporter also saw gpt-5-mini, kimi-k3 and claude-haiku-4.5 rejected while their fields say enabled + chat completions. All three work on our login, so their plan probably has a restriction these fields don't show. That case is not covered here.
Verified
Ran it locally: yes
- Built the CLI on main and on this branch, signed in with
e2e login github-copilot(gh token, real Copilot plan), and rane2e models github-copilot:
| main | this branch |
|---|---|
claude-opus-5 Claude Opus 5 Anthropic, tools, vision | claude-opus-5 Claude Opus 5 Anthropic, tools, vision, not enabled |
gpt-6-luna GPT-6 Luna OpenAI, tools, vision | gpt-6-luna GPT-6 Luna OpenAI, tools, vision, no chat completions |
gpt-5.5 GPT-5.5 OpenAI, tools, vision | gpt-5.5 GPT-5.5 OpenAI, tools, vision, not enabled, no chat completions |
claude-sonnet-5 Claude Sonnet 5 Anthropic, tools, vision | unchanged |
- Sent every listed id to
/chat/completionswith the stored token: all 22 unmarked ids returned 200, and all 21 marked ids returned 400. generateTextwith a tool through the builtcopilot():
claude-haiku-4.5 ok [{"target":"Click me"}]
gpt-5-mini ok [{"target":"Click me"}]
gpt-6-luna FAIL model "gpt-6-luna" is not accessible via the /chat/completions endpoint
claude-opus-5 FAIL The requested model is not supported.