anomalyco / anomalyco/opencode

tui v2: question prompt steals input from command palette

Open
#39,252 1 comment 0 reactions 1 assignee View on GitHub

@kommander is already working on this.

Since Jul 28, 2026.

2.0
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

  1. Start a task that causes the assistant to invoke the question tool after a delay.
  2. Open the command palette with Ctrl+P before the question is presented.
  3. Wait for the question to appear behind the palette.
  4. Press Esc once.
  5. 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:

  1. Prompt the agent to run sleep 5, then invoke the question tool.
  2. Open Commands with Ctrl+P while sleep 5 is running.
  3. When the question arrives, Commands remains visibly open over Questions.
  4. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.