anomalyco / anomalyco/opencode
tui v2: question prompt steals input from command palette
@kommander is already working on this.
Since Jul 28, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
In the V2 TUI, the visible command palette and an incoming question prompt compete for keyboard input. The palette remains open and visually topmost, but question-mode bindings consume keys, leaving the visible modal and keyboard owner out of sync.
Environment
- opencode version:
0.0.0-next-16339 - OS: Darwin 25.5.0, arm64
- Terminal: Ghostty (
TERM_PROGRAM=ghostty,COLORTERM=truecolor); independently reproduced in a private standalone TUI under tmux - Shell:
/bin/zsh - Install/channel:
opencode2, next - Active plugins: none found in project or user config
Reproduction
- Start a task that causes the assistant to invoke the question tool after a delay.
- Open the command palette with
Ctrl+Pbefore the question is presented. - Wait for the question to appear behind the palette.
- Press
Esconce. - Separately, allow a question to become active first and then press
Ctrl+P.
Expected Behavior
The topmost visible UI should exclusively own keyboard input. An incoming question should either wait, close or suspend the command palette before taking focus, or remain inactive until the palette closes.
When a question is already active, Ctrl+P should either open the command palette or provide clear modal behavior rather than being silently consumed.
Actual Behavior
If the command palette is open when the question arrives, the palette stays visible over the dimmed question UI, but the question captures keyboard input. Pressing Esc once cancels the question while leaving the visible command palette open.
In the inverse order, pressing Ctrl+P while a question is active does not open the command palette because the question UI consumes the shortcut.
Additional Context
This is consistently reproducible. It was independently reproduced on 0.0.0-next-16339 in a private standalone TUI under tmux with a deterministic delayed question:
- Prompt the agent to run
sleep 5, then invoke the question tool. - Open Commands with
Ctrl+Pwhilesleep 5is running. - When the question arrives, Commands remains visibly open over Questions.
- Press
Esc; Questions is dismissed and Commands remains open.
Related reports:
- #28935 reports the equivalent command-palette/question conflict in V1.
- #29999 describes the broader V1 dialog keymap priority problem.
- #36652 covered background prompt input behind V2 modals.
- #36656 fixed #36652 by preventing deferred prompt focus restoration while another dialog remains on the stack. That fix does not appear to cover question-mode key routing or global command-palette shortcuts while a question is active.
No workaround has been identified beyond avoiding the command palette while a question may arrive.
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.