anomalyco / anomalyco/opencode
TUI hangs after a multi-question prompt (question tool, 3 questions) — keys and Ctrl+C unresponsive
@simonklee is already working on this.
Since Aug 19, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.