Skip to content

Opencode just hangs when trying to start it #2476

Closed

Description

@tonsV2

I tried installing with both yarn and bash. The result is the same

tons@p1 ~/I/d/docker-deployment (ci/add-smoke-test)> opencode --print-logs --log-level DEBUG
INFO  2025-09-07T12:45:45 +125ms service=default version=0.6.4 args=["--print-logs","--log-level","DEBUG"] opencode
INFO  2025-09-07T12:45:45 +1ms service=project directory=/home/tons/IdeaProjects/dhis2/docker-deployment fromDirectory
INFO  2025-09-07T12:45:45 +24ms service=config path=/home/tons/.config/opencode/config.json loading
INFO  2025-09-07T12:45:45 +1ms service=config path=/home/tons/.config/opencode/opencode.json loading
INFO  2025-09-07T12:45:45 +4ms service=config path=/home/tons/.config/opencode/opencode.jsonc loading
INFO  2025-09-07T12:45:45 +4ms service=plugin path=opencode-copilot-auth@0.0.2 loading plugin
INFO  2025-09-07T12:45:45 +1ms service=bun pkg=opencode-copilot-auth version=0.0.2 installing package using Bun's default registry resolution
INFO  2025-09-07T12:45:45 +0ms service=bun cmd=["/home/tons/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/tons/.cache/opencode","opencode-copilot-auth@0.0.2"] cwd=/home/tons/.cache/opencode running

I doubt that it matters but I'm using Fedora. Please let me know if there's any additional information that I should supply.

Activity

  1. github-actions commented on Sep 7, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The root cause appears to be related to plugin installation during startup, specifically the opencode-copilot-auth plugin failing to install via bun.

    Feel free to ignore if none of these address your specific case.

  2. marn-in-prod commented on Sep 7, 2025

    @marn-in-prod

    I can also confirm that opencode has started to hang when i start.

    opencode --print-logs --log-level DEBUG does not return anything for me, just hangs.

  3. rekram1-node commented on Sep 7, 2025

    @rekram1-node
    Contributor

    what do yall see if you run:

     cd ~/.cache/opencode/ && BUN_BE_BUN=1 opencode pm ls
    
  4. marn-in-prod commented on Sep 7, 2025

    @marn-in-prod

    I uninstalled and installed v 62, then it automatically upgraded and it works now on the latest version. So it's no longer an issue for me

  5. MichaelrMentele commented on Oct 30, 2025

    @MichaelrMentele

    Installing with brew or curl hangs for me on start with:

    ➜  Development opencode --print-logs --log-level DEBUG
    ============================================================
    Bun v1.3.0 (b0a6feca) macOS x64
    macOS v15.3.1
    CPU: sse42 popcnt
    Args:
    Features: no_avx2 no_avx
    

    Running on mac m2

  6. rekram1-node commented on Oct 30, 2025

    @rekram1-node
    Contributor

    @MichaelrMentele what is the output if u do opencode run hello --print-logs

  7. renanfranca commented on Nov 13, 2025

    @renanfranca

    I know it is closed, but I want to help others like me who face that problem even in the latest version v1.0.61.

    The solution for me was to delete (or rename) the bun cache folder ~/.bun/install/cache.

    Here is where the bun got stuck after running opencode run hello --print-logs (thanks @rekram1-node ):

    renanfranca@renanfranca-pc:~$ opencode run hello --print-logs
    INFO  2025-11-13T10:58:56 +188ms service=default version=1.0.55 args=["run","hello","--print-logs"] opencode
    INFO  2025-11-13T10:58:56 +0ms service=default directory=/home/renanfranca creating instance
    INFO  2025-11-13T10:58:56 +0ms service=project directory=/home/renanfranca fromDirectory
    INFO  2025-11-13T10:58:56 +4ms service=default directory=/home/renanfranca bootstrapping
    INFO  2025-11-13T10:58:56 +7ms service=config path=/home/renanfranca/.config/opencode/config.json loading
    INFO  2025-11-13T10:58:56 +0ms service=config path=/home/renanfranca/.config/opencode/opencode.json loading
    INFO  2025-11-13T10:58:56 +3ms service=config path=/home/renanfranca/.config/opencode/opencode.jsonc loading
    INFO  2025-11-13T10:58:56 +1ms service=config path=/home/renanfranca/.config/opencode/opencode.jsonc loading
    INFO  2025-11-13T10:58:56 +0ms service=config path=/home/renanfranca/.config/opencode/opencode.json loading
    INFO  2025-11-13T10:58:56 +1ms service=bun cmd=["/home/renanfranca/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.55","--exact"] cwd=/home/renanfranca/.config/opencode running
    INFO  2025-11-13T10:58:56 +1ms service=config path=/home/renanfranca/.opencode/opencode.jsonc loading
    INFO  2025-11-13T10:58:56 +0ms service=config path=/home/renanfranca/.opencode/opencode.json loading
    INFO  2025-11-13T10:58:56 +0ms service=bun cmd=["/home/renanfranca/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.55","--exact"] cwd=/home/renanfranca/.opencode running
    INFO  2025-11-13T10:58:56 +3ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    installed @opencode-ai/plugin@1.0.55
    
    [1.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-11-13T10:58:56 +0ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    installed @opencode-ai/plugin@1.0.55
    
    [1.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-11-13T10:58:56 +2ms service=plugin path=opencode-copilot-auth@0.0.4 loading plugin
    INFO  2025-11-13T10:58:56 +1ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
    INFO  2025-11-13T10:58:56 +11ms service=bus type=* subscribing
    INFO  2025-11-13T10:58:56 +0ms service=bus type=session.updated subscribing
    INFO  2025-11-13T10:58:56 +0ms service=bus type=message.updated subscribing
    INFO  2025-11-13T10:58:56 +0ms service=bus type=message.part.updated subscribing
    INFO  2025-11-13T10:58:56 +0ms service=format init
    INFO  2025-11-13T10:58:56 +0ms service=bus type=file.edited subscribing
    INFO  2025-11-13T10:58:56 +1ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls, lua-ls enabled LSP servers
    INFO  2025-11-13T10:58:56 +1ms service=bus type=command.executed subscribing
    INFO  2025-11-13T10:58:56 +301ms service=server method=POST path=/session request
    INFO  2025-11-13T10:58:56 +0ms service=server status=started method=POST path=/session request
    INFO  2025-11-13T10:58:56 +2ms service=session id=ses_58321ac2bffek0TQ3mpcJgc0zw version=1.0.55 projectID=global directory=/home/renanfranca title=New session - 2025-11-13T10:58:56.596Z time={"created":1763031536596,"updated":1763031536596} created
    INFO  2025-11-13T10:58:56 +1ms service=bus type=session.created publishing
    INFO  2025-11-13T10:58:56 +0ms service=bus type=session.updated publishing
    INFO  2025-11-13T10:58:56 +2ms service=server status=completed duration=5 method=POST path=/session request
    INFO  2025-11-13T10:58:56 +0ms service=server method=GET path=/config request
    INFO  2025-11-13T10:58:56 +0ms service=server status=started method=GET path=/config request
    INFO  2025-11-13T10:58:56 +1ms service=server status=completed duration=1 method=GET path=/config request
    INFO  2025-11-13T10:58:56 +2ms service=server method=GET path=/event request
    INFO  2025-11-13T10:58:56 +0ms service=server status=started method=GET path=/event request
    INFO  2025-11-13T10:58:56 +1ms service=server event connected
    INFO  2025-11-13T10:58:56 +1ms service=bus type=* subscribing
    INFO  2025-11-13T10:58:56 +1ms service=server status=completed duration=3 method=GET path=/event request
    INFO  2025-11-13T10:58:56 +3ms service=server method=POST path=/session/ses_58321ac2bffek0TQ3mpcJgc0zw/message request
    INFO  2025-11-13T10:58:56 +0ms service=server status=started method=POST path=/session/ses_58321ac2bffek0TQ3mpcJgc0zw/message request
    INFO  2025-11-13T10:58:56 +3ms service=session.prompt session=ses_58321ac2bffek0TQ3mpcJgc0zw prompt
    INFO  2025-11-13T10:58:56 +0ms service=server status=completed duration=3 method=POST path=/session/ses_58321ac2bffek0TQ3mpcJgc0zw/message request
    INFO  2025-11-13T10:58:56 +2ms service=bus type=message.updated publishing
    INFO  2025-11-13T10:58:56 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T10:58:56 +1ms service=bus type=session.updated publishing
    ERROR 2025-11-13T10:58:56 +1ms service=provider error=ENOENT: no such file or directory, open '/home/renanfranca/.local/state/opencode/tui' failed to find last used model
    INFO  2025-11-13T10:58:56 +1ms service=provider status=started state
    INFO  2025-11-13T10:58:56 +1ms service=models.dev file={} refreshing
    INFO  2025-11-13T10:58:56 +2ms service=provider init
    INFO  2025-11-13T10:58:56 +1ms service=provider providerID=opencode found
    INFO  2025-11-13T10:58:56 +0ms service=provider status=completed duration=4 state
    INFO  2025-11-13T10:58:56 +0ms service=provider providerID=opencode modelID=grok-code getModel
    INFO  2025-11-13T10:58:56 +0ms service=provider status=started providerID=opencode getSDK
    INFO  2025-11-13T10:58:56 +2ms service=bun pkg=@ai-sdk/openai-compatible version=latest installing package using Bun's default registry resolution
    INFO  2025-11-13T10:58:56 +0ms service=bun cmd=["/home/renanfranca/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/renanfranca/.cache/opencode","@ai-sdk/openai-compatible@latest"] cwd=/home/renanfranca/.cache/opencode running

    Then I ran the same command opencode run hello --print-logs after removing the bun cache folder, and it worked 😄:

    renanfranca@renanfranca-pc:~$ opencode run hello --print-logs
    INFO  2025-11-13T11:04:55 +194ms service=default version=1.0.55 args=["run","hello","--print-logs"] opencode
    INFO  2025-11-13T11:04:55 +1ms service=default directory=/home/renanfranca creating instance
    INFO  2025-11-13T11:04:55 +0ms service=project directory=/home/renanfranca fromDirectory
    INFO  2025-11-13T11:04:55 +4ms service=default directory=/home/renanfranca bootstrapping
    INFO  2025-11-13T11:04:55 +10ms service=config path=/home/renanfranca/.config/opencode/config.json loading
    INFO  2025-11-13T11:04:55 +1ms service=config path=/home/renanfranca/.config/opencode/opencode.json loading
    INFO  2025-11-13T11:04:55 +3ms service=config path=/home/renanfranca/.config/opencode/opencode.jsonc loading
    INFO  2025-11-13T11:04:55 +1ms service=config path=/home/renanfranca/.config/opencode/opencode.jsonc loading
    INFO  2025-11-13T11:04:55 +0ms service=config path=/home/renanfranca/.config/opencode/opencode.json loading
    INFO  2025-11-13T11:04:55 +1ms service=bun cmd=["/home/renanfranca/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.55","--exact"] cwd=/home/renanfranca/.config/opencode running
    INFO  2025-11-13T11:04:55 +1ms service=config path=/home/renanfranca/.opencode/opencode.jsonc loading
    INFO  2025-11-13T11:04:55 +0ms service=config path=/home/renanfranca/.opencode/opencode.json loading
    INFO  2025-11-13T11:04:55 +0ms service=bun cmd=["/home/renanfranca/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.55","--exact"] cwd=/home/renanfranca/.opencode running
    INFO  2025-11-13T11:04:55 +2ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    installed @opencode-ai/plugin@1.0.55
    
    [1.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-11-13T11:04:55 +1ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    installed @opencode-ai/plugin@1.0.55
    
    [1.00ms] done
     stderr=Saved lockfile
     done
    INFO  2025-11-13T11:04:55 +2ms service=plugin path=opencode-copilot-auth@0.0.4 loading plugin
    INFO  2025-11-13T11:04:55 +2ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
    INFO  2025-11-13T11:04:55 +12ms service=bus type=* subscribing
    INFO  2025-11-13T11:04:55 +0ms service=bus type=session.updated subscribing
    INFO  2025-11-13T11:04:55 +0ms service=bus type=message.updated subscribing
    INFO  2025-11-13T11:04:55 +0ms service=bus type=message.part.updated subscribing
    INFO  2025-11-13T11:04:55 +0ms service=format init
    INFO  2025-11-13T11:04:55 +0ms service=bus type=file.edited subscribing
    INFO  2025-11-13T11:04:55 +1ms service=lsp serverIds=deno, typescript, vue, eslint, gopls, ruby-lsp, pyright, elixir-ls, zls, csharp, rust, clangd, svelte, astro, jdtls, lua-ls enabled LSP servers
    INFO  2025-11-13T11:04:55 +1ms service=bus type=command.executed subscribing
    INFO  2025-11-13T11:04:56 +321ms service=server method=POST path=/session request
    INFO  2025-11-13T11:04:56 +0ms service=server status=started method=POST path=/session request
    INFO  2025-11-13T11:04:56 +1ms service=session id=ses_5831c2ffcffeH4xl5oLFCDuQkl version=1.0.55 projectID=global directory=/home/renanfranca title=New session - 2025-11-13T11:04:56.067Z time={"created":1763031896067,"updated":1763031896067} created
    INFO  2025-11-13T11:04:56 +0ms service=bus type=session.created publishing
    INFO  2025-11-13T11:04:56 +1ms service=bus type=session.updated publishing
    INFO  2025-11-13T11:04:56 +1ms service=server status=completed duration=3 method=POST path=/session request
    INFO  2025-11-13T11:04:56 +1ms service=server method=GET path=/config request
    INFO  2025-11-13T11:04:56 +0ms service=server status=started method=GET path=/config request
    INFO  2025-11-13T11:04:56 +0ms service=server status=completed duration=0 method=GET path=/config request
    INFO  2025-11-13T11:04:56 +3ms service=server method=GET path=/event request
    INFO  2025-11-13T11:04:56 +0ms service=server status=started method=GET path=/event request
    INFO  2025-11-13T11:04:56 +0ms service=server event connected
    INFO  2025-11-13T11:04:56 +1ms service=bus type=* subscribing
    INFO  2025-11-13T11:04:56 +1ms service=server status=completed duration=2 method=GET path=/event request
    INFO  2025-11-13T11:04:56 +1ms service=server method=POST path=/session/ses_5831c2ffcffeH4xl5oLFCDuQkl/message request
    INFO  2025-11-13T11:04:56 +0ms service=server status=started method=POST path=/session/ses_5831c2ffcffeH4xl5oLFCDuQkl/message request
    INFO  2025-11-13T11:04:56 +3ms service=session.prompt session=ses_5831c2ffcffeH4xl5oLFCDuQkl prompt
    INFO  2025-11-13T11:04:56 +0ms service=server status=completed duration=3 method=POST path=/session/ses_5831c2ffcffeH4xl5oLFCDuQkl/message request
    INFO  2025-11-13T11:04:56 +3ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:04:56 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:04:56 +1ms service=bus type=session.updated publishing
    ERROR 2025-11-13T11:04:56 +1ms service=provider error=ENOENT: no such file or directory, open '/home/renanfranca/.local/state/opencode/tui' failed to find last used model
    INFO  2025-11-13T11:04:56 +1ms service=provider status=started state
    INFO  2025-11-13T11:04:56 +1ms service=models.dev file={} refreshing
    INFO  2025-11-13T11:04:56 +3ms service=provider init
    INFO  2025-11-13T11:04:56 +1ms service=provider providerID=opencode found
    INFO  2025-11-13T11:04:56 +0ms service=provider status=completed duration=5 state
    INFO  2025-11-13T11:04:56 +1ms service=provider providerID=opencode modelID=grok-code getModel
    INFO  2025-11-13T11:04:56 +0ms service=provider status=started providerID=opencode getSDK
    INFO  2025-11-13T11:04:56 +0ms service=bun pkg=@ai-sdk/openai-compatible version=latest installing package using Bun's default registry resolution
    INFO  2025-11-13T11:04:56 +0ms service=bun cmd=["/home/renanfranca/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/renanfranca/.cache/opencode","@ai-sdk/openai-compatible@latest"] cwd=/home/renanfranca/.cache/opencode running
    INFO  2025-11-13T11:04:58 +2359ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    + opencode-anthropic-auth@0.0.2
    + opencode-copilot-auth@0.0.4
    
    installed @ai-sdk/openai-compatible@1.0.27
    
    21 packages installed [2.35s]
     stderr=Resolving dependencies
    Resolved, downloaded and extracted [2]
    Saved lockfile
     done
    INFO  2025-11-13T11:04:58 +72ms service=provider status=completed duration=2431 providerID=opencode getSDK
    INFO  2025-11-13T11:04:58 +1ms service=provider providerID=opencode modelID=grok-code found
    INFO  2025-11-13T11:04:58 +0ms service=session.lock sessionID=ses_5831c2ffcffeH4xl5oLFCDuQkl locked
    INFO  2025-11-13T11:04:58 +0ms service=session.prompt session=ses_5831c2ffcffeH4xl5oLFCDuQkl sessionID=ses_5831c2ffcffeH4xl5oLFCDuQkl locking
    INFO  2025-11-13T11:04:58 +10ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:04:58 +6ms service=session.prompt session=ses_5831c2ffcffeH4xl5oLFCDuQkl process
    INFO  2025-11-13T11:04:58 +13ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:04:58 +0ms service=bus type=session.updated publishing
    INFO  2025-11-13T11:04:58 +1ms service=bus type=session.diff publishing
    INFO  2025-11-13T11:04:59 +1443ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:04:59 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +25ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +21ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:00 +22ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +1028ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +38ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +12ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +26ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +2ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +46ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +2ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +4ms service=bus type=message.part.updated publishing
    INFO  2025-11-13T11:05:01 +1ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=message.updated publishing
    
    Hello! How can I help with your software engineering tasks?
    
    INFO  2025-11-13T11:05:01 +3ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:05:01 +1ms service=session.compaction pruning
    INFO  2025-11-13T11:05:01 +0ms service=session.lock sessionID=ses_5831c2ffcffeH4xl5oLFCDuQkl unlocked
    INFO  2025-11-13T11:05:01 +0ms service=session.prompt session=ses_5831c2ffcffeH4xl5oLFCDuQkl sessionID=ses_5831c2ffcffeH4xl5oLFCDuQkl unlocking
    INFO  2025-11-13T11:05:01 +1ms service=bus type=session.idle publishing
    INFO  2025-11-13T11:05:01 +0ms service=default directory=/home/renanfranca disposing instance
    INFO  2025-11-13T11:05:01 +0ms service=state key=/home/renanfranca waiting for state disposal to complete
    INFO  2025-11-13T11:05:01 +1ms service=bus type=message.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=session.updated publishing
    INFO  2025-11-13T11:05:01 +0ms service=bus type=session.diff publishing
    INFO  2025-11-13T11:05:01 +0ms service=session.compaction pruned=0 total=0 found
    INFO  2025-11-13T11:05:03 +2217ms service=bus type=session.updated publishing
    INFO  2025-11-13T11:05:03 +0ms service=state key=/home/renanfranca state disposal completed
    
  8. rekram1-node commented on Nov 13, 2025

    @rekram1-node
    Contributor

    thanks for sharing!

  9. 512z commented on Nov 25, 2025

    @512z

    for me the solution is to add either:

    1. 'DOMAIN-SUFFIX,npmjs.org,your-vpn-proxy' when not using tun mode
    2. or ’PROCESS-NAME,bun,direct‘ when using tun mode

    this is because bun ignores proxy settings

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