Connect via GitHub Copilot is forcing API key entry instead of GH login OAuth/web flow #4307

Closed
opened 2026-02-16 17:43:22 -05:00 by yindo · 11 comments
Owner

Originally created by @erawhctim on GitHub (Jan 6, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

When running /connect and selecting GitHub Copilot, opencode switches to the "API Key" entry field instead of the code-based auth flow (https://github.com/login/device).

I was following the docs for connecting to GH Copilot, but can't seem to trigger the browser-based auth flow that GitHub expects 🤔

Plugins

none

OpenCode version

1.1.3

Steps to reproduce

  1. Fresh install of opencode
  2. run opencode
  3. /connect + select GH Copilot

Screenshot and/or share link

https://github.com/user-attachments/assets/a49662de-c794-4f5f-a1d6-005135137d3e

Operating System

macOS 26.2

Terminal

Ghostty

Originally created by @erawhctim on GitHub (Jan 6, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description When running `/connect` and selecting GitHub Copilot, opencode switches to the "API Key" entry field instead of the code-based auth flow (`https://github.com/login/device`). I was following [the docs for connecting to GH Copilot](https://opencode.ai/docs/providers#github-copilot), but can't seem to trigger the browser-based auth flow that GitHub expects 🤔 ### Plugins none ### OpenCode version 1.1.3 ### Steps to reproduce 1. Fresh install of opencode 2. run opencode 3. /connect + select GH Copilot ### Screenshot and/or share link https://github.com/user-attachments/assets/a49662de-c794-4f5f-a1d6-005135137d3e ### Operating System macOS 26.2 ### Terminal Ghostty
yindo added the opentuibug labels 2026-02-16 17:43:22 -05:00
yindo closed this issue 2026-02-16 17:43:22 -05:00
Author
Owner

@erawhctim commented on GitHub (Jan 6, 2026):

I also tried opencode auth login and selected copilot that way, but the same issue persists

@erawhctim commented on GitHub (Jan 6, 2026): I also tried `opencode auth login` and selected copilot that way, but the same issue persists
Author
Owner

@erawhctim commented on GitHub (Jan 6, 2026):

I tried fully uninstalling and re-installing, then running opencode upgrade 1.0.223 to try and install an older version, which seems to work (I don't use bun to manage the opencode install, so I'm just using the CLI), but if there's a more appropriate way to run older versions let me know and I can try and test one of them.

running 1.0.223 just fails immediately on start-up:

{
  "name": "BunInstallFailedError",
  "data": {
    "pkg": "opencode-copilot-auth",
    "version": "0.0.9"
  }
}

I manually installed bun (don't think I ever used it, so it might not have been installed before), which worked, but still throws the same error...

Terminal output:

 ~/D/W  ➡ bun --version
1.3.5
 ~/D/W  ➡ opencode -v
1.0.222
 ~/D/W  ➡ opencode
{
  "name": "BunInstallFailedError",
  "data": {
    "pkg": "opencode-copilot-auth",
    "version": "0.0.9"
  }
}
@erawhctim commented on GitHub (Jan 6, 2026): I tried fully uninstalling and re-installing, then running `opencode upgrade 1.0.223` to try and install an older version, which seems to work (I don't use bun to manage the opencode install, so I'm just using the CLI), but if there's a more appropriate way to run older versions let me know and I can try and test one of them. running 1.0.223 just fails immediately on start-up: ``` { "name": "BunInstallFailedError", "data": { "pkg": "opencode-copilot-auth", "version": "0.0.9" } } ``` I manually installed bun (don't think I ever used it, so it might not have been installed before), which worked, but still throws the same error... Terminal output: ``` ~/D/W ➡ bun --version 1.3.5 ~/D/W ➡ opencode -v 1.0.222 ~/D/W ➡ opencode { "name": "BunInstallFailedError", "data": { "pkg": "opencode-copilot-auth", "version": "0.0.9" } } ```
Author
Owner

@rekram1-node commented on GitHub (Jan 6, 2026):

You dont need bun, but if you cant get the plugin isntalled then yeah it would use the other form of auth…

Do you have a proxy or anything thatd be blocking that install?

@rekram1-node commented on GitHub (Jan 6, 2026): You dont need bun, but if you cant get the plugin isntalled then yeah it would use the other form of auth… Do you have a proxy or anything thatd be blocking that install?
Author
Owner

@erawhctim commented on GitHub (Jan 6, 2026):

Ahh, ok, so there's a bun plugin that's installed separately that handles the copilot auth - that makes more sense now 👍

I checked the logs and saw OC was trying to hit our company's internal Artifactory, that could certainly be the problem. Or just general network security blocking it somehow.

How can I debug the opencode-copilot-auth plugin installation failure further?

@erawhctim commented on GitHub (Jan 6, 2026): Ahh, ok, so there's a bun plugin that's installed separately that handles the copilot auth - that makes more sense now 👍 I checked the logs and saw OC was trying to hit our company's internal Artifactory, that could certainly be the problem. Or just general network security blocking it somehow. How can I debug the `opencode-copilot-auth` plugin installation failure further?
Author
Owner

@erawhctim commented on GitHub (Jan 6, 2026):

I think we can close this; the root cause is related to my local setup. I'll keep digging and post the resolution back here. Sorry for the noise!

One suggestion: when installing 1.1.3 out-of-the-box and trying to run copilot auth, I never saw any errors related to bun or the artifactory registry that I have configured. It could be a nice UX improvement if opencode was able to tell me "copilot auth plugin failed to load, falling back to API key auth" or something to that effect.

@erawhctim commented on GitHub (Jan 6, 2026): I think we can close this; the root cause is related to my local setup. I'll keep digging and post the resolution back here. Sorry for the noise! One suggestion: when installing 1.1.3 out-of-the-box and trying to run copilot auth, I never saw any errors related to bun or the artifactory registry that I have configured. It could be a nice UX improvement if opencode was able to tell me "copilot auth plugin failed to load, falling back to API key auth" or something to that effect.
Author
Owner

@geoffp commented on GitHub (Jan 6, 2026):

I'm having the exact same issue with a similar corporate environment. I'm hoping you find a workaround!

@geoffp commented on GitHub (Jan 6, 2026): I'm having the exact same issue with a similar corporate environment. I'm hoping you find a workaround!
Author
Owner

@Odonno commented on GitHub (Jan 9, 2026):

Same issue, using 1.1.8

@Odonno commented on GitHub (Jan 9, 2026): Same issue, using 1.1.8
Author
Owner

@Odonno commented on GitHub (Jan 9, 2026):

Ok, here is the fix I used:

NODE_TLS_REJECT_UNAUTHORIZED=0 opencode auth login
@Odonno commented on GitHub (Jan 9, 2026): Ok, here is the fix I used: ``` NODE_TLS_REJECT_UNAUTHORIZED=0 opencode auth login ```
Author
Owner

@geoffp commented on GitHub (Jan 21, 2026):

NODE_TLS_REJECT_UNAUTHORIZED=0 opencode auth login has no effect for me unfortunately.

@geoffp commented on GitHub (Jan 21, 2026): `NODE_TLS_REJECT_UNAUTHORIZED=0 opencode auth login` has no effect for me unfortunately.
Author
Owner

@rekram1-node commented on GitHub (Jan 21, 2026):

Btw this shouldn't be neceessary on latest versions

@rekram1-node commented on GitHub (Jan 21, 2026): Btw this shouldn't be neceessary on latest versions
Author
Owner

@rekram1-node commented on GitHub (Jan 21, 2026):

There is no external install of plugin, it's baked in

@rekram1-node commented on GitHub (Jan 21, 2026): There is no external install of plugin, it's baked in
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4307