Repository navigation
Github copilot failing to authorize #8552
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
So I'm having issues authorizing opencode with github copilot, the authorization gets stopped very quickly.
I also had issues authenticating the gh cli with github so I suspect this is the same issue as:
cli/cli#9370
Since this is the issue I've had when using gh auth login, for gh cli it's possible to work around the issue as described in comments (basically by being quick and copying the code beforehand).
one solution is to have the challange code shown before you start pooling github.
with debug logs:
opencode auth login --log-level DEBUG --print-logs
INFO 2026-01-14T22:59:13 +235ms service=default version=1.1.20 args=["auth","login","--log-level","DEBUG","--print-logs"] opencode
INFO 2026-01-14T22:59:13 +0ms service=default directory=/home/osboxes/Documents/semaphore/semaphore creating instance
INFO 2026-01-14T22:59:13 +0ms service=project directory=/home/osboxes/Documents/semaphore/semaphore fromDirectory
┌ Add credential
INFO 2026-01-14T22:59:13 +17ms service=models.dev file={} refreshing
INFO 2026-01-14T22:59:13 +106ms service=config path=/home/osboxes/.config/opencode/config.json loading
INFO 2026-01-14T22:59:13 +0ms service=config path=/home/osboxes/.config/opencode/opencode.json loading
INFO 2026-01-14T22:59:13 +0ms service=config path=/home/osboxes/.config/opencode/opencode.jsonc loading
INFO 2026-01-14T22:59:13 +2ms service=bun cmd=["/home/osboxes/.opencode/bin/opencode","add","@opencode-ai/plugin@1.1.20","--exact"] cwd=/home/osboxes/.config/opencode running
DEBUG 2026-01-14T22:59:13 +1ms service=config loading config from /home/osboxes/.opencode/opencode.jsonc
INFO 2026-01-14T22:59:13 +0ms service=config path=/home/osboxes/.opencode/opencode.jsonc loading
DEBUG 2026-01-14T22:59:13 +1ms service=config loading config from /home/osboxes/.opencode/opencode.json
INFO 2026-01-14T22:59:13 +0ms service=config path=/home/osboxes/.opencode/opencode.json loading
INFO 2026-01-14T22:59:13 +0ms service=bun cmd=["/home/osboxes/.opencode/bin/opencode","add","@opencode-ai/plugin@1.1.20","--exact"] cwd=/home/osboxes/.opencode running
INFO 2026-01-14T22:59:13 +11ms service=models.dev file={} refreshing
INFO 2026-01-14T22:59:13 +1ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
installed @opencode-ai/plugin@1.1.20
[3.00ms] done
stderr=Saved lockfile
done
INFO 2026-01-14T22:59:13 +0ms service=bun cmd=["/home/osboxes/.opencode/bin/opencode","install"] cwd=/home/osboxes/.config/opencode running
INFO 2026-01-14T22:59:13 +0ms service=bun code=0 stdout=bun add v1.3.5 (1e86cebd)
installed @opencode-ai/plugin@1.1.20
[2.00ms] done
stderr=Saved lockfile
done
INFO 2026-01-14T22:59:13 +1ms service=bun cmd=["/home/osboxes/.opencode/bin/opencode","install"] cwd=/home/osboxes/.opencode running
│
◆ Select provider
│ Search: _
│ ● OpenCode Zen (recommended)
│ ○ Anthropic
│ ○ GitHub Copilot
│ ○ OpenAI
│ ○ Google
◇ Select provider
│ GitHub Copilot
INFO 2026-01-14T22:59:16 +2982ms service=plugin name=CodexAuthPlugin loading internal plugin
INFO 2026-01-14T22:59:16 +0ms service=plugin path=opencode-copilot-auth@0.0.12 loading plugin
INFO 2026-01-14T22:59:16 +3ms service=plugin path=opencode-anthropic-auth@0.0.8 loading plugin
INFO 2026-01-14T22:59:16 +16ms service=plugin path=@gitlab/opencode-gitlab-auth@1.3.0 loading plugin
│
◇ Select GitHub deployment type
│ GitHub.com
│
● Go to: https://github.com/login/device
│
● Enter code: A70D-8000
│
■ Failed to authorize
│
└ Done
Plugins
No response
OpenCode version
1.1.20
Steps to reproduce
I don't think this can be easily reproduced as it's environment specific. Guys over on cli/cli#9370 couldn't reproduce it
Screenshot and/or share link
No response
Operating System
Ubuntu 24.04 (vm on Windows host)
Terminal
Gnome Terminal
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
github-actions commentedon Jan 14, 2026
This issue appears to be unique in our repository - it's specifically about the device flow authorization timing out too quickly during GitHub Copilot authentication.
While we don't have an exact duplicate, you may find the following related issues useful for context on GitHub Copilot authentication challenges:
The core issue you're experiencing aligns with the gh CLI issue you referenced (cli/cli#9370), which suggests this might be an upstream GitHub API limitation or browser behavior related to the device flow timeout.
If you're able to gather any additional environment-specific debugging information (browser logs, network timing, exact timeout duration), it would help in diagnosing whether this is a client-side or server-side timeout issue.
rekram1-node commentedon Jan 14, 2026
commenting so u know i saw this
DennisLoska commentedon Jan 15, 2026
Hey, also noticed this issue today:
INFO 2026-01-15T17:03:29 +1714ms service=plugin name=CodexAuthPlugin loading internal plugin INFO 2026-01-15T17:03:29 +1ms service=plugin name=CopilotAuthPlugin loading internal plugin INFO 2026-01-15T17:03:29 +0ms service=plugin path=opencode-anthropic-auth@0.0.9 loading plugin INFO 2026-01-15T17:03:29 +30ms service=plugin path=@gitlab/opencode-gitlab-auth@1.3.0 loading plugin ERROR 2026-01-15T17:03:33 +3286ms service=default name=Error message=Failed to initiate device authorization stack=Error: Failed to initiate device authorization at authorize (src/plugin/copilot.ts:172:25) at processTicksAndRejections (native:7:39) fatalwhen running
opencode auth loginon1.1.21, having Brave as default browser - could also be related to a Github API outage?https://www.githubstatus.com/
rekram1-node commentedon Jan 15, 2026
Is there anything special about your environment? Idk what is failing for u
DennisLoska commentedon Jan 15, 2026
Found it! So the problem was running the command within my tmux session! After detaching and trying it worked (same for
ghcli btw`)!hamir-certain commentedon Jan 15, 2026
Interesting, I'm using i3wm, but I really can't see how that can cause this
rekram1-node commentedon Jan 15, 2026
You can auth in tui btw,
opencodethen /connect
hamir-certain commentedon Jan 15, 2026
Yeah I've initially tried that, it just closes the overlay (I guess same error happens)
opencode_copilot.mp4
rekram1-node commentedon Jan 15, 2026
hmmm
hamir-certain commentedon Jan 15, 2026
I'll try the new version of the gh cli ad they've released a version containing this fix cli/oauth@f0230b8
If that works I'll try building opencode with a modified copilot plugin, handling the
slow_downresponse might do the trick.hamir-certain commentedon Jan 16, 2026
hey @rekram1-node I've made a PR that fixed this issue for me #8986