anomalyco / anomalyco/opencode
GITHUB_TOKEN incorrectly activates GitHub Copilot provider
@rekram1-node is already working on this.
Since Aug 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Description
When GITHUB_TOKEN is set for GitHub tooling, OpenCode also treats github-copilot as connected through generic environment authentication, even when no Copilot OAuth credential exists. opencode auth list consequently reports GitHub Copilot under Environment.
This bypasses Copilot-specific OAuth, model-discovery, and request-routing logic. Without the endpoint metadata returned by Copilot model discovery, gpt-5.6-sol is sent to /chat/completions, resulting in request failure every time.
The minimal expected behavior is to ignore GITHUB_TOKEN when automatically activating the github-copilot provider and require the existing Copilot OAuth flow. Generic environment authentication for other providers should remain unchanged.
Plugins
None; this concerns the built-in GitHub Copilot provider.
OpenCode version
dev at e00890c672 (1.18.21)
Steps to reproduce
- Use a clean OpenCode data directory with no stored
github-copilotcredential. - Set a non-empty
GITHUB_TOKEN. - Run
opencode auth list. - Observe that GitHub Copilot is reported under Environment despite no Copilot OAuth login.
- Select a newer Copilot model such as
github-copilot/gpt-5.6-sol. - Observe that OpenCode uses the generic environment-token provider path instead of Copilot OAuth/model discovery, resulting in
gpt-5.6-solbeing sent to/chat/completionsand failing.
Screenshot and/or share link
No response
Operating System
macOS and Linux
Terminal
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.