Github copilot failing to authorize #5944

Closed
opened 2026-02-16 17:58:39 -05:00 by yindo · 0 comments
Owner

Originally created by @hamir-certain on GitHub (Jan 14, 2026).

Originally assigned to: @rekram1-node on GitHub.

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:
https://github.com/cli/cli/issues/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 https://github.com/cli/cli/issues/9370 couldn't reproduce it

Screenshot and/or share link

No response

Operating System

Ubuntu 24.04 (vm on Windows host)

Terminal

Gnome Terminal

Originally created by @hamir-certain on GitHub (Jan 14, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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: https://github.com/cli/cli/issues/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 https://github.com/cli/cli/issues/9370 couldn't reproduce it ### Screenshot and/or share link _No response_ ### Operating System Ubuntu 24.04 (vm on Windows host) ### Terminal Gnome Terminal
yindo added the bug label 2026-02-16 17:58:39 -05:00
yindo closed this issue 2026-02-16 17:58:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#5944