opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Github copilot failing to authorize

Open hamir-certain opened this issue 1 day ago • 10 comments

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/[email protected]","--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/[email protected]","--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/[email protected]

[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/[email protected]

[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 [email protected] loading plugin
INFO  2026-01-14T22:59:16 +3ms service=plugin [email protected] loading plugin
INFO  2026-01-14T22:59:16 +16ms service=plugin path=@gitlab/[email protected] 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

hamir-certain avatar Jan 14 '26 23:01 hamir-certain