Skip to content

Opencode fails to launch #4179

Closed
Closed

Description

@nabn

Description

running opencode hangs

I uninstalled all versions of opencode from the system, the ~/.opencode directory, then installed with bun and tried again. Still same behaviour

OpenCode version

1.0.55

Steps to reproduce

which opencode
opencode not found
~ bun i -g opencode-ai
bun add v1.3.1 (89fa0f34)

installed opencode-ai@1.0.55 with binaries:
 - opencode

3 packages installed [209.00ms]
~ which opencode
/Users/nabn/.bun/bin/opencode
~ opencode
> hangs

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    bugSomething isn't working
    on Nov 11, 2025
  2. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 11, 2025
  3. github-actions commented on Nov 11, 2025

    @github-actions
    Contributor

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

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

  4. rekram1-node commented on Nov 11, 2025

    @rekram1-node
    Contributor

    @nabn can u do anything with opencode?

    Is this happening in every dir?

    Can u try:
    opencode run hello --print-logs

  5. adaptive-shield-matrix commented on Nov 11, 2025

    @adaptive-shield-matrix

    I had the same problem of opencode crashing but then
    after upgrading bun and running the hello script - it suddenly started working again. 🤷

    ❯ opencode 
    168 |         return wa();
    169 |       });
    170 |     }
    171 |     function za(a) {
    172 |       for (;0 < a.length; )
    173 |         a.shift()(h);
                          ^
    RuntimeError: access to a null reference (evaluating 'a5.shift()(h2)')
          at za (../../node_modules/.bun/@opentui+core@0.0.0-20251108-0c7899b1+81ecd8642a1892ca/node_modules/@opentui/core/index-z5bb2h2z.js:173:17)
          at a5 (../../node_modules/.bun/@opentui+core@0.0.0-20251108-0c7899b1+81ecd8642a1892ca/node_modules/@opentui/core/index-z5bb2h2z.js:1325:11)
          at Mb (../../node_modules/.bun/@opentui+core@0.0.0-20251108-0c7899b1+81ecd8642a1892ca/node_modules/@opentui/core/index-z5bb2h2z.js:1347:18)
          at Lb (../../node_modules/.bun/@opentui+core@0.0.0-20251108-0c7899b1+81ecd8642a1892ca/node_modules/@opentui/core/index-z5bb2h2z.js:1319:13)
          at a5 (../../node_modules/.bun/@opentui+core@0.0.0-20251108-0c7899b1+81ecd8642a1892ca/node_modules/@opentui/core/index-z5bb2h2z.js:1265:90)
          at b2 (../../node_modules/.bun/@opentui+core@0.0.0-20251108-0c7899b1+81ecd8642a1892ca/node_modules/@opentui/core/index-z5bb2h2z.js:1268:9)
    
    Bun v1.3.1 (Linux x64 baseline)
    
    ❯ bun upgrade
    Bun v1.3.2 is out! You're on v1.3.1
    [17.09s] Upgraded.
    
    Welcome to Bun v1.3.2!
    
    What's new in Bun v1.3.2:
    
        https://bun.com/blog/release-notes/bun-v1.3.2
    
    Report any bugs:
    
        https://github.com/oven-sh/bun/issues
    
    Commit log:
    
        https://github.com/oven-sh/bun/compare/bun-v1.3.1...bun-v1.3.2
    
    adaptive-convex-auth [ main][✘!+?⇡][📦 v0.0.0][🥟 v1.3.2][ v22.20.0][⏱ 17s]
    ❯ opencode run hello --print-logs
    INFO  2025-11-11T07:41:21 +515ms service=default version=1.0.55 args=["run","hello","--print-logs"] opencode
    INFO  2025-11-11T07:41:21 +2ms service=default directory=/home/david/Coding/adaptive-convex-auth creating instance
    INFO  2025-11-11T07:41:21 +1ms service=project directory=/home/david/Coding/adaptive-convex-auth fromDirectory
    INFO  2025-11-11T07:41:21 +38ms service=storage index=1 running migration
    INFO  2025-11-11T07:41:21 +59ms service=default directory=/home/david/Coding/adaptive-convex-auth bootstrapping
    INFO  2025-11-11T07:41:21 +4ms service=config path=/home/david/.config/opencode/config.json loading
    INFO  2025-11-11T07:41:21 +0ms service=config path=/home/david/.config/opencode/opencode.json loading
    INFO  2025-11-11T07:41:21 +12ms service=config path=/home/david/.config/opencode/opencode.jsonc loading
    INFO  2025-11-11T07:41:21 +6ms service=config path=/home/david/.config/opencode/opencode.jsonc loading
    INFO  2025-11-11T07:41:21 +1ms service=config path=/home/david/.config/opencode/opencode.json loading
    INFO  2025-11-11T07:41:21 +4ms service=bun cmd=["/home/david/.opencode/bin/opencode","add","@opencode-ai/plugin@1.0.55","--exact"] cwd=/home/david/.config/opencode running
    INFO  2025-11-11T07:41:28 +6724ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    installed @opencode-ai/plugin@1.0.55
    
    2 packages installed [6.72s]
     stderr=Resolving dependencies
    Resolved, downloaded and extracted [8]
    Saved lockfile
     done
    INFO  2025-11-11T07:41:28 +4ms service=plugin path=opencode-copilot-auth@0.0.4 loading plugin
    INFO  2025-11-11T07:41:28 +0ms service=bun pkg=opencode-copilot-auth version=0.0.4 installing package using Bun's default registry resolution
    INFO  2025-11-11T07:41:28 +1ms service=bun cmd=["/home/david/.opencode/bin/opencode","add","--force","--exact","--cwd","/home/david/.cache/opencode","opencode-copilot-auth@0.0.4"] cwd=/home/david/.cache/opencode running
    INFO  2025-11-11T07:41:34 +5893ms service=bun code=0 stdout=bun add v1.3.1 (89fa0f34)
    
    + @ai-sdk/openai-compatible@1.0.27
    + opencode-anthropic-auth@0.0.2
    
    installed opencode-copilot-auth@0.0.4
    
    21 packages installed [5.89s]
     stderr=Resolving dependencies
    Resolved, downloaded and extracted [14]
    Saved lockfile
     done
    INFO  2025-11-11T07:41:34 +3ms service=plugin path=opencode-anthropic-auth@0.0.2 loading plugin
    INFO  2025-11-11T07:41:34 +34ms service=bus type=* subscribing
    INFO  2025-11-11T07:41:34 +0ms service=bus type=session.updated subscribing
    INFO  2025-11-11T07:41:34 +1ms service=bus type=message.updated subscribing
    INFO  2025-11-11T07:41:34 +0ms service=bus type=message.part.updated subscribing
    INFO  2025-11-11T07:41:34 +0ms service=format init
    INFO  2025-11-11T07:41:34 +0ms service=bus type=file.edited subscribing
    INFO  2025-11-11T07:41:34 +0ms 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-11T07:41:34 +2ms service=bus type=command.executed subscribing
    INFO  2025-11-11T07:41:34 +49ms service=server method=POST path=/session request
    INFO  2025-11-11T07:41:34 +0ms service=server status=started method=POST path=/session request
    INFO  2025-11-11T07:41:34 +5ms service=session id=ses_58e231589ffewvOP4zev1vgzWu version=1.0.55 projectID=a045e53f7493419bc072c1a6815417164740f6bc directory=/home/david/Coding/adaptive-convex-auth title=New session - 2025-11-11T07:41:34.710Z time={"created":1762846894710,"updated":1762846894710} created
    INFO  2025-11-11T07:41:34 +1ms service=bus type=session.created publishing
    INFO  2025-11-11T07:41:34 +0ms service=bus type=session.updated publishing
    INFO  2025-11-11T07:41:34 +2ms service=server status=completed duration=8 method=POST path=/session request
    INFO  2025-11-11T07:41:34 +6ms service=server method=GET path=/config request
    INFO  2025-11-11T07:41:34 +0ms service=server status=started method=GET path=/config request
    INFO  2025-11-11T07:41:34 +1ms service=server status=completed duration=1 method=GET path=/config request
    INFO  2025-11-11T07:41:34 +4ms service=server method=GET path=/event request
    INFO  2025-11-11T07:41:34 +0ms service=server status=started method=GET path=/event request
    INFO  2025-11-11T07:41:34 +1ms service=server event connected
    INFO  2025-11-11T07:41:34 +4ms service=bus type=* subscribing
    INFO  2025-11-11T07:41:34 +1ms service=server status=completed duration=6 method=GET path=/event request
    INFO  2025-11-11T07:41:34 +5ms service=server method=POST path=/session/ses_58e231589ffewvOP4zev1vgzWu/message request
    INFO  2025-11-11T07:41:34 +0ms service=server status=started method=POST path=/session/ses_58e231589ffewvOP4zev1vgzWu/message request
    INFO  2025-11-11T07:41:34 +7ms service=session.prompt session=ses_58e231589ffewvOP4zev1vgzWu prompt
    INFO  2025-11-11T07:41:34 +1ms service=server status=completed duration=8 method=POST path=/session/ses_58e231589ffewvOP4zev1vgzWu/message request
    INFO  2025-11-11T07:41:34 +7ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:34 +8ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:34 +3ms service=bus type=session.updated publishing
    INFO  2025-11-11T07:41:34 +8ms service=provider status=started state
    INFO  2025-11-11T07:41:34 +2ms service=models.dev file={} refreshing
    INFO  2025-11-11T07:41:34 +10ms service=provider init
    INFO  2025-11-11T07:41:34 +4ms service=provider providerID=openrouter found
    INFO  2025-11-11T07:41:34 +0ms service=provider providerID=opencode found
    INFO  2025-11-11T07:41:34 +0ms service=provider status=completed duration=16 state
    INFO  2025-11-11T07:41:34 +0ms service=provider providerID=opencode modelID=grok-code getModel
    INFO  2025-11-11T07:41:34 +1ms service=provider status=started providerID=opencode getSDK
    INFO  2025-11-11T07:41:34 +155ms service=provider status=completed duration=155 providerID=opencode getSDK
    INFO  2025-11-11T07:41:34 +3ms service=provider providerID=opencode modelID=grok-code found
    INFO  2025-11-11T07:41:34 +0ms service=session.lock sessionID=ses_58e231589ffewvOP4zev1vgzWu locked
    INFO  2025-11-11T07:41:34 +0ms service=session.prompt session=ses_58e231589ffewvOP4zev1vgzWu sessionID=ses_58e231589ffewvOP4zev1vgzWu locking
    INFO  2025-11-11T07:41:34 +55ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:35 +15ms service=session.prompt session=ses_58e231589ffewvOP4zev1vgzWu process
    INFO  2025-11-11T07:41:35 +28ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:35 +1ms service=bus type=session.updated publishing
    INFO  2025-11-11T07:41:35 +1ms service=bus type=session.diff publishing
    INFO  2025-11-11T07:41:37 +2160ms service=snapshot hash=ed59ba0a29c6beea486ec2acb6c83542cb01530a
     cwd=/home/david/Coding/adaptive-convex-auth git=/home/david/.local/share/opencode/snapshot/a045e53f7493419bc072c1a6815417164740f6bc tracking
    INFO  2025-11-11T07:41:37 +5ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +3ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +1ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +0ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +2ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +690ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:37 +9ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:38 +197ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:38 +4ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:38 +2ms service=bus type=message.part.updated publishing
    
    Hello!
    
    INFO  2025-11-11T07:41:38 +22ms service=snapshot hash=ed59ba0a29c6beea486ec2acb6c83542cb01530a
     cwd=/home/david/Coding/adaptive-convex-auth git=/home/david/.local/share/opencode/snapshot/a045e53f7493419bc072c1a6815417164740f6bc tracking
    INFO  2025-11-11T07:41:38 +3ms service=bus type=message.part.updated publishing
    INFO  2025-11-11T07:41:38 +1ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:38 +90ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:38 +3ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:38 +1ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:38 +0ms service=session.compaction pruning
    INFO  2025-11-11T07:41:38 +1ms service=session.lock sessionID=ses_58e231589ffewvOP4zev1vgzWu unlocked
    INFO  2025-11-11T07:41:38 +0ms service=session.prompt session=ses_58e231589ffewvOP4zev1vgzWu sessionID=ses_58e231589ffewvOP4zev1vgzWu unlocking
    INFO  2025-11-11T07:41:38 +2ms service=bus type=session.idle publishing
    INFO  2025-11-11T07:41:38 +1ms service=default directory=/home/david/Coding/adaptive-convex-auth disposing instance
    INFO  2025-11-11T07:41:38 +1ms service=state key=/home/david/Coding/adaptive-convex-auth waiting for state disposal to complete
    INFO  2025-11-11T07:41:38 +10ms service=session.compaction pruned=0 total=0 found
    INFO  2025-11-11T07:41:38 +3ms service=bus type=session.updated publishing
    INFO  2025-11-11T07:41:38 +0ms service=bus type=message.updated publishing
    INFO  2025-11-11T07:41:38 +1ms service=bus type=session.diff publishing
    INFO  2025-11-11T07:41:39 +1289ms service=bus type=session.updated publishing
    INFO  2025-11-11T07:41:39 +1ms service=state key=/home/david/Coding/adaptive-convex-auth state disposal completed
    
    
    
  6. nabn commented on Nov 11, 2025

    @nabn
    Author

    yesterday it would literally freeze ghostty panes and only way to get out of it was to kill the ghostty tab. I installed a software update on my mac, restarted, and now the problem is gone

    I did try running with --print-logs but even that wouldn't work.

    Closing as now fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions