Skip to content

feat(desktop): sign in to GitHub Copilot with an account besides PAT #3388

Description

@hgaol

Problem

Problem

GitHub Copilot is the only registered oauth_token provider with no sign-in
flow.

GitHubCopilotSubscriptionService.connectExistingLogin() does not authenticate
—
it scavenges a credential you already have:

// apps/desktop/src/main/oauth/github-copilot-subscription-service.ts:179
for (const name of ['COPILOT_GITHUB_TOKEN', 'GH_TOKEN', 'GITHUB_TOKEN'] as
const) { ... }
const result = await execFileAsync('gh', ['auth', 'token'], { ... });

It then rejects classic PATs, so a user must go mint a fine-grained PAT with the
Copilot Requests permission. The service's own failure message admits the primary
path often does not work: 普通 gh auth login 可能不包含该权限.

Settings reflects this — the card reads "GitHub Copilot subscription access using
an existing GitHub login" (provider-display-copy.ts:259) and renders a bespoke
GitHubCopilotLoginPanel (provider-oauth-section.tsx:176) rather than the
standard OAuth login card the other three account providers share.

Codex and xAI already sign in with device flows (#1950, and the presentation
noted in #3219). Copilot never got one.

Desired outcome

A user with a Copilot subscription clicks sign in, authorizes a code in the browser, and gets a working connection — no PAT, no gh CLI, no scope hunting.
Importing an existing gh credential stays available for machines that are already authenticated.

Alternatives or workarounds

Today: install gh, or create a fine-grained PAT with Copilot Requests and put it in COPILOT_GITHUB_TOKEN.

Considered leaving Copilot on its bespoke IPC namespace and only improving the error copy, but the missing flow is the actual gap.

Activity

  1. added
    enhancement
    on Aug 21, 2026
  2. added 6 commits that reference this issue on Aug 21, 2026
    1527686
    c7d8924
    1b42de5
    4f133f1
    66c59b9
    38657e4
  3. added
    help wanted
    on Aug 22, 2026
  4. removed
    help wanted
    on Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions