Skip to content

TUI hangs after a multi-question prompt (question tool, 3 questions) — keys and Ctrl+C unresponsive #43376

Closed as not planned

Description

@liuxiaominglove

Version

1.18.18

Environment

  • OS: macOS (darwin)
  • Terminal: iTerm2
  • Shell: zsh

Summary

When the assistant uses the question tool with 3 questions (each with several options), the TUI occasionally freezes: the prompt renders, but no key presses are processed, Enter does not confirm, and even Ctrl+C does nothing. Only force-quitting the terminal tab (Cmd+W) recovers.

Evidence (from ~/.local/share/opencode/log/opencode.log)

timestamp=2026-08-19T02:51:22.951Z level=INFO run=1b64c3b7 message=asking id=que_017ee37c7001Lagagb98IBJpRm questions=3
timestamp=2026-08-19T02:52:04.300Z level=INFO run=50d90807 message=cleanup prune=7.days
timestamp=2026-08-19T03:10:05.649Z level=INFO run=241dc7a4 message="creating instance" directory=...

Note: after asking questions=3, there was no replied, no rejected, and no error — the backend never received an answer, but the process stayed alive (the cleanup timer kept firing ~40s later), which points to the TUI event loop being stuck rather than the process crashing.

Intermittent (not always reproducible)

Historical log shows questions=3 working fine in other sessions:

  • 16:23:02 asking questions=3 → 16:29:57 replied (~7 min, user took time)
  • 20:52:56 asking questions=3 → 20:55:58 replied (~3 min)
  • 23:13:52 asking questions=3 → 23:16:14 rejected (user pressed Esc)

This hang is the first full freeze (neither replied nor rejected for ~19 min until the user force-quit).

Workaround found

Force-quit and relaunch opencode — session history is preserved in the DB (the same session.id continues after restart).

Activity

  1. github-actions commented on Aug 19, 2026

    @github-actions
    Contributor

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

    If the root cause is different (question tool event loop specifically), feel free to keep this open — the log evidence here is a useful addition.

  2. manascb1344 commented on Sep 26, 2026

    @manascb1344

    Same exact experience here — a 3-question prompt via the question tool:

    • Selecting options and tab-cycling between the question tabs works fine
    • On the final Confirm tab, Enter does nothing, clicking Confirm is ignored, and Esc/Ctrl+C are also dead
    • Only force-quitting the terminal recovers the session

    Environment: opencode v1.18.30, Linux, TERM=xterm-256color, zsh.
    My logs also show asking questions=3 with no replied/rejected afterwards — the backend never receives the answer, so it's the TUI never delivering the reply rather than a backend issue.

    Still reproducible in 1.18.30.

  3. simonklee commented on Sep 27, 2026

    @simonklee
    Member

    Is it still reproducible in v2?

  4. Burwin commented on Oct 2, 2026

    @Burwin

    Same hang on 1.18.29, Linux, tmux. Not limited to iTerm, and not limited to 3 questions.

    The prompt had 2 questions. The TUI was sitting on the Confirm screen with the recommended options already filled in. The footer said tab, enter to submit, esc to dismiss. The keyboard did nothing. Clicks on the question buttons did nothing. The mouse wheel still scrolled the transcript, so the process was not fully frozen.

    The process stayed up and idle (epoll_wait, not spinning). After the ask there was no replied, rejected, or error:

    timestamp=2026-10-02T02:08:49.674Z level=INFO message=asking id=que_0fa5f120a001E5IiLC6sTFcCCc questions=2
    

    The question tool call stayed status=running.

  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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