Skip to content

Bug: opencode run and TUI exits hang on v0.15+ #3213

@jlrosende

Description

@jlrosende

Summary

  • On OpenCode 0.15.0 and later, the CLI launched with opencode run <prompt> never returns control to the shell; it finishes streaming output but the process keeps running until interrupted with Ctrl+C.
  • In the interactive TUI on the same versions, issuing /exit or pressing Ctrl+C closes the interface visually, yet the terminal prompt never comes back—the process must still be terminated with Ctrl+C.
  • Downgrading to 0.14.7 immediately restores the correct behaviour, confirming this is a regression introduced in the 0.15.0 line.

Steps to Reproduce

Scenario A – opencode run

  1. Install OpenCode 0.15.0 or later.
  2. Run opencode run "say hello" --print-logs inside a project directory.
  3. Wait for the response to finish streaming.
  4. Observe that the command never exits back to the shell; the cursor sits on a blank line until you press Ctrl+C.

Scenario B – TUI /exit

  1. Start the interactive TUI (opencode <path|project>).
  2. After the assistant finishes a task, enter /exit or press Ctrl+C to leave the session.
  3. The TUI clears and disappears, but the shell prompt does not return; pressing Ctrl+C is still required to regain control.

Expected Behavior

  • opencode run should terminate automatically once the assistant finishes processing the prompt.
  • /exit or Ctrl+C inside the TUI should gracefully shut down the session and immediately return the shell prompt.

Actual Behavior

  • opencode run stays attached to the session indefinitely, leaving the terminal blocked until interrupted.
  • The TUI window closes, yet the underlying process continues running and the shell prompt never reappears on its own.

Environment

  • OpenCode: 0.15.0, 0.15.1, 0.15.2 (works as expected on 0.14.7)
  • Platforms tested:
    • Windows 11 (WSL2 Ubuntu 24.04)
    • Fedora 42 (bare metal)
  • Shells/Terminals: Windows Terminal (WSL), GNOME Terminal and Ghostty on Fedora (bash and zsh)

Additional Notes

  • Clearing caches, reinstalling, or switching providers/models does not resolve the hang.
  • --print-logs does not show any obvious error; logs end after the final session.prompt ... finish-step entry.
  • Downgrading to 0.14.7 is the only workaround identified so far.

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