Opencode hangs #1389

Closed
opened 2026-02-16 17:30:46 -05:00 by yindo · 9 comments
Owner

Originally created by @nabn on GitHub (Aug 20, 2025).

Originally assigned to: @thdxr on GitHub.

~/Developer/raycast-scripts oc auth login --print-logs
INFO  2025-08-20T05:23:00 +43ms service=default version=0.5.8 args=["auth","login","--print-logs"] opencode
INFO  2025-08-20T05:23:00 +0ms service=app cwd=/Users/nabn/Developer/raycast-scripts creating
INFO  2025-08-20T05:23:00 +1ms service=app git

┌  Add credential
INFO  2025-08-20T05:23:00 +2ms service=models.dev file={} refreshing
INFO  2025-08-20T05:23:00 +105ms service=models.dev file={} refreshing
│
◇  Select provider
│  GitHub Copilot
INFO  2025-08-20T05:23:04 +3830ms service=app name=plugin registering service
INFO  2025-08-20T05:23:04 +1ms service=app name=config registering service
INFO  2025-08-20T05:23:04 +3ms service=config path=/Users/nabn/.config/opencode/config.json loading
INFO  2025-08-20T05:23:04 +0ms service=config path=/Users/nabn/.config/opencode/opencode.json loading
INFO  2025-08-20T05:23:04 +0ms service=config path=/Users/nabn/.config/opencode/opencode.jsonc loading
INFO  2025-08-20T05:23:04 +3ms service=config agent={} mode={} plugin=[] username=nabn loaded
INFO  2025-08-20T05:23:04 +0ms service=plugin path=opencode-copilot-auth loading plugin
INFO  2025-08-20T05:23:04 +0ms service=bun pkg=opencode-copilot-auth version=latest installing package using Bun's default registry resolution
INFO  2025-08-20T05:23:04 +1ms service=bun cmd=["/Users/nabn/.opencode/bin/opencode","add","--force","--exact","--cwd","/Users/nabn/.cache/opencode","opencode-copilot-auth@latest"] cwd=/Users/nabn/.cache/opencode running

then stays like this.

I've tried deleting cache folders/re-authenticating but no dice.

Originally created by @nabn on GitHub (Aug 20, 2025). Originally assigned to: @thdxr on GitHub. ```shell ~/Developer/raycast-scripts oc auth login --print-logs INFO 2025-08-20T05:23:00 +43ms service=default version=0.5.8 args=["auth","login","--print-logs"] opencode INFO 2025-08-20T05:23:00 +0ms service=app cwd=/Users/nabn/Developer/raycast-scripts creating INFO 2025-08-20T05:23:00 +1ms service=app git ┌ Add credential INFO 2025-08-20T05:23:00 +2ms service=models.dev file={} refreshing INFO 2025-08-20T05:23:00 +105ms service=models.dev file={} refreshing │ ◇ Select provider │ GitHub Copilot INFO 2025-08-20T05:23:04 +3830ms service=app name=plugin registering service INFO 2025-08-20T05:23:04 +1ms service=app name=config registering service INFO 2025-08-20T05:23:04 +3ms service=config path=/Users/nabn/.config/opencode/config.json loading INFO 2025-08-20T05:23:04 +0ms service=config path=/Users/nabn/.config/opencode/opencode.json loading INFO 2025-08-20T05:23:04 +0ms service=config path=/Users/nabn/.config/opencode/opencode.jsonc loading INFO 2025-08-20T05:23:04 +3ms service=config agent={} mode={} plugin=[] username=nabn loaded INFO 2025-08-20T05:23:04 +0ms service=plugin path=opencode-copilot-auth loading plugin INFO 2025-08-20T05:23:04 +0ms service=bun pkg=opencode-copilot-auth version=latest installing package using Bun's default registry resolution INFO 2025-08-20T05:23:04 +1ms service=bun cmd=["/Users/nabn/.opencode/bin/opencode","add","--force","--exact","--cwd","/Users/nabn/.cache/opencode","opencode-copilot-auth@latest"] cwd=/Users/nabn/.cache/opencode running ``` then stays like this. I've tried deleting cache folders/re-authenticating but no dice.
yindo closed this issue 2026-02-16 17:30:46 -05:00
Author
Owner

@rekram1-node commented on GitHub (Aug 20, 2025):

do you by any chance have a special npm setup? Or by chance are you behind corporate firewall?

@rekram1-node commented on GitHub (Aug 20, 2025): do you by any chance have a special npm setup? Or by chance are you behind corporate firewall?
Author
Owner

@rekram1-node commented on GitHub (Aug 20, 2025):

And this only happens with copilot? If it is only copilot I think it may be related to what I said above^^

@rekram1-node commented on GitHub (Aug 20, 2025): And this only happens with copilot? If it is only copilot I think it may be related to what I said above^^
Author
Owner

@thdxr commented on GitHub (Aug 20, 2025):

can you show us what's in ~/.cache/opencode/package.json

@thdxr commented on GitHub (Aug 20, 2025): can you show us what's in `~/.cache/opencode/package.json`
Author
Owner

@nabn commented on GitHub (Aug 20, 2025):

can you show us what's in ~/.cache/opencode/package.json

{
  "dependencies": {}
}
@nabn commented on GitHub (Aug 20, 2025): > can you show us what's in `~/.cache/opencode/package.json` ``` { "dependencies": {} } ```
Author
Owner

@nabn commented on GitHub (Aug 20, 2025):

do you by any chance have a special npm setup? Or by chance are you behind corporate firewall?

@rekram1-node
no i was on my home wifi, no vpn. i am using mise to manage my tool versions, could that be it?

~ which bun
/Users/nabn/.local/share/mise/installs/bun/1.2.18/bin/bun
~ which npm
/Users/nabn/.local/share/mise/installs/node/24.2.0/bin/npm
@nabn commented on GitHub (Aug 20, 2025): > do you by any chance have a special npm setup? Or by chance are you behind corporate firewall? @rekram1-node no i was on my home wifi, no vpn. i am using `mise` to manage my tool versions, could that be it? ``` ~ which bun /Users/nabn/.local/share/mise/installs/bun/1.2.18/bin/bun ~ which npm /Users/nabn/.local/share/mise/installs/node/24.2.0/bin/npm ```
Author
Owner

@nabn commented on GitHub (Aug 20, 2025):

also can confirm that it was working up until yesterday. I have had one such issue a couple days ago which fixed itself after a few attempts. It's completely stopped responding starting yesterday.

it's not just opencode auth login, running just opencode hangs similarly.

Edit:
As I was writing this, it miraculously started working again. It feels like one of the network requests it makes on boot is really slow but there is no feedback/logs. I'll try a local build with more logging if it happens again.

fyi I'm in Australia, wouldn't be surprised if latency was a factor

@nabn commented on GitHub (Aug 20, 2025): also can confirm that it was working up until yesterday. I have had one such issue a couple days ago which fixed itself after a few attempts. It's completely stopped responding starting yesterday. it's not just `opencode auth login`, running just `opencode` hangs similarly. Edit: As I was writing this, it miraculously started working again. It feels like one of the network requests it makes on boot is really slow but there is no feedback/logs. I'll try a local build with more logging if it happens again. fyi I'm in Australia, wouldn't be surprised if latency was a factor
Author
Owner

@rekram1-node commented on GitHub (Aug 20, 2025):

another person on opencode discord just reported this @thdxr, they had same empty dep object but no special configs otherwise

@rekram1-node commented on GitHub (Aug 20, 2025): another person on opencode discord just reported this @thdxr, they had same empty dep object but no special configs otherwise
Author
Owner

@nabn commented on GitHub (Aug 21, 2025):

closing as it's resolved for me.

@nabn commented on GitHub (Aug 21, 2025): closing as it's resolved for me.
Author
Owner

@blurgyy commented on GitHub (Aug 26, 2025):

One of my machines is consistently facing this issue every time opencode is updated on that machine. I can reliably fix it with the following steps:

  1. Delete ~/.cache/opencode entirely
  2. Launch opencode, and it hangs, and just hit ^C to quit the hanging opencode
  3. run bun add --no-cache --force --exact --cwd ~/.cache/opencode opencode-anthropic-auth@0.0.2 opencode-copilot-auth@0.0.2 @ai-sdk/openai-compatible@latest
  4. Now opencode should launch without hanging, BUT if I try to send a message to a model from GitHub Copilot, there will be no response (maybe other openai-compatible API endpoints also have this problem, I did not check)
  5. The fix is to close opencode again, and edit the version of @ai-sdk/openai-compatible in ~/.cache/opencode/package.json to "latest", here is my working package.json at the time of writing:
{
  "dependencies": {
    "@ai-sdk/openai-compatible": "latest",
    "opencode-anthropic-auth": "0.0.2",
    "opencode-copilot-auth": "0.0.2"
  }
}

Now opencode should stop hanging on launch, and can generate a response.

@blurgyy commented on GitHub (Aug 26, 2025): One of my machines is consistently facing this issue every time opencode is updated on that machine. I can reliably fix it with the following steps: 1. Delete ~/.cache/opencode entirely 2. Launch opencode, and it hangs, and just hit ^C to quit the hanging opencode 3. run `bun add --no-cache --force --exact --cwd ~/.cache/opencode opencode-anthropic-auth@0.0.2 opencode-copilot-auth@0.0.2 @ai-sdk/openai-compatible@latest` 4. Now opencode should launch without hanging, BUT if I try to send a message to a model from GitHub Copilot, there will be no response (maybe other openai-compatible API endpoints also have this problem, I did not check) 5. The fix is to close opencode again, and edit the version of `@ai-sdk/openai-compatible` in `~/.cache/opencode/package.json` to `"latest"`, here is my working package.json at the time of writing: ```json { "dependencies": { "@ai-sdk/openai-compatible": "latest", "opencode-anthropic-auth": "0.0.2", "opencode-copilot-auth": "0.0.2" } } ``` Now opencode should stop hanging on launch, and can generate a response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1389