Skip to content

bug: Worker has been terminated #32694

Closed

Description

@y-matsuwitter

Description

After sending one message and getting a reply, opencode crashes and the TUI shows Worker has been terminated. The session becomes unusable and I have to restart. It happens on every conversation, right after the first interaction.

I narrowed it down: the crash still happens with --pure (no plugins/MCP), outside tmux, and with OPENCODE_DISABLE_MOUSE=1. So it's not plugins, the terminal, or mouse handling.

The macOS crash report points at a native crash, not a UI bug:

  • Exception: EXC_BREAKPOINT (SIGTRAP)
  • Faulting thread: HTTP Client (not the render worker)

So the bundled Bun runtime traps on the HTTP client thread after the first network round-trip, the whole process dies, and the opentui render worker goes down with it — which is what surfaces as Worker has been terminated.

I checked the bundled Bun version across releases by extracting the opencode-darwin-arm64 binaries:

opencode bundled Bun result
≤ 1.15.4 1.3.13 works
1.15.5 → 1.17.7 1.3.14 crashes
current dev build 1.3.14 still crashes

Downgrading to 1.15.4 (Bun 1.3.13) fixes it. Anything on Bun 1.3.14 crashes. This lines up with the known Bun 1.3.14 SIGTRAP problem on macOS 26 / Apple Silicon (see #31563, #32544, upstream oven-sh/bun#32144) — but here it's a runtime crash during HTTP activity, not just the crash-on-exit those issues describe.

Plugins

Reproduces with --pure (no plugins). My normal config uses opencode-openai-codex-auth + a small local notification plugin, but disabling everything does not help.

OpenCode version

1.17.7 (also confirmed crashing on the current dev build, which still ships Bun 1.3.14)

Steps to reproduce

  1. macOS 26.x on Apple Silicon, opencode 1.17.7
  2. opencode --pure
  3. Send any single message and wait for the reply
  4. Crash: TUI shows Worker has been terminated; a ~/Library/Logs/DiagnosticReports/opencode.exe-*.ips is written with EXC_BREAKPOINT on the HTTP Client thread
  5. npm install -g [email protected] (Bun 1.3.13) → no longer crashes

Screenshot and/or share link

Crash report excerpt:

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Termination:     Trace/BPT trap: 5
Faulting thread: HTTP Client

Operating System

macOS 26.5.1 (build 25F80), Apple M4 Pro (arm64), installed via npm

Terminal

Reproduces regardless of terminal (tested inside and outside tmux; TERM=tmux-256color and a plain terminal both crash)

Activity

  1. ryanseddon commented on Jun 17, 2026

    @ryanseddon

    This issue has been plaguing me for the last few days.

    Whenever I try to view a subagent via crtl + x down it consistently crashes with the worker terminated error. Trying to resume the session just shows the error, if I restart the session and continue if I do the subagent viewing it crashes again.

    I have opencode: 1.17.8.

  2. mdrv commented on Jun 20, 2026

    @mdrv

    I also kept getting Worker has been terminated on v1.17.x on subsequent prompts and had to restart every time. OpenCode v1.16.x has been fine (on Arch Linux). I believe it's a regression that can only be fixed on source side.

    Update: Fixed in v1.17.10 (no more terminated worker error/rejection).

  3. rober-tm commented on Jun 21, 2026

    @rober-tm

    I've had the same bug since all versions of 1.17.x. I tried each one to see if it would be fixed, but no luck. The only stable version is 1.16.2. I'm on Ubuntu Server 24. Any alternative solutions or patches?

  4. ryanseddon commented on Jun 21, 2026

    @ryanseddon

    Ive got a fork here with a fix that would be worth trying. It fixes the issue for me on macOS ryanseddon@ca3eeee

  5. mdrv commented on Jun 21, 2026

    @mdrv

    @ryanseddon Your fork didn't fix the issue for me (on Linux); still blocked with Worker has been terminated error message on second prompt. Should I create a new issue?

  6. changed the title [-]opencode crashes (SIGTRAP on HTTP Client thread) after first message — bundled Bun 1.3.14 on macOS 26 / Apple Silicon[/-] [+]bug: Worker has been terminated[/+] on Jun 22, 2026
  7. misterdojo777 commented on Jun 22, 2026

    @misterdojo777

    This issue has been plaguing me for the last few days.

    Whenever I try to view a subagent via crtl + x down it consistently crashes with the worker terminated error. Trying to resume the session just shows the error, if I restart the session and continue if I do the subagent viewing it crashes again.

    I have opencode: 1.17.8.

    confirmed bug for me as well: downgrading to 1.16.0(or 1) fixed the issue so it's somewhere introduced after this. I think it has to do with the new background sub-agents since the little TUI element (ctrl+b -> move sub-agent to the background) was broken.

  8. rober-tm commented on Jun 23, 2026

    @rober-tm

    I installed version 1.17.9 and the error persists on Ubuntu Linux 24.04.4, using opencode connected via SSH with the Windows terminal (PowerShell).

  9. ryanseddon commented on Jun 24, 2026

    @ryanseddon

    Confirmed that 1.17.9 is also still doing the worker has been terminated error for me.

    My fork with a fix is the one that works without error for me.

  10. rekram1-node commented on Jun 24, 2026

    @rekram1-node
    Collaborator

    the fix hasnt released yet.

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