Skip to content

Opencode hangs #2095

Closed
Closed

Description

@nabn
~/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.

Activity

  1. rekram1-node commented on Aug 20, 2025

    @rekram1-node
    Collaborator

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

  2. rekram1-node commented on Aug 20, 2025

    @rekram1-node
    Collaborator

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

  3. thdxr commented on Aug 20, 2025

    @thdxr
    Member

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

  4. nabn commented on Aug 20, 2025

    @nabn
    Author

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

    {
      "dependencies": {}
    }
    
  5. nabn commented on Aug 20, 2025

    @nabn
    Author

    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
    
  6. nabn commented on Aug 20, 2025

    @nabn
    Author

    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

  7. rekram1-node commented on Aug 20, 2025

    @rekram1-node
    Collaborator

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

  8. nabn commented on Aug 21, 2025

    @nabn
    Author

    closing as it's resolved for me.

  9. blurgyy commented on Aug 26, 2025

    @blurgyy

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions