Skip to content

GITHUB_TOKEN incorrectly activates GitHub Copilot provider #44113

Closed as not planned

Description

@jooh

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

  1. Use a clean OpenCode data directory with no stored github-copilot credential.
  2. Set a non-empty GITHUB_TOKEN.
  3. Run opencode auth list.
  4. Observe that GitHub Copilot is reported under Environment despite no Copilot OAuth login.
  5. Select a newer Copilot model such as github-copilot/gpt-5.6-sol.
  6. Observe that OpenCode uses the generic environment-token provider path instead of Copilot OAuth/model discovery, resulting in gpt-5.6-sol being sent to /chat/completions and failing.

Screenshot and/or share link

No response

Operating System

macOS and Linux

Terminal

No response

Activity

  1. github-actions commented on Oct 22, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions