Skip to content

fix(tui): queue busy prompts after interrupt - #34530

Closed
span5201 wants to merge 1 commit into
anomalyco:devfrom
span5201:tui-prompt-queue-after-interrupt
Closed

fix(tui): queue busy prompts after interrupt#34530
span5201 wants to merge 1 commit into
anomalyco:devfrom
span5201:tui-prompt-queue-after-interrupt

Conversation

@span5201

Copy link
Copy Markdown

Issue for this PR

Closes #9291
Related to #10966, #30494

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The full-screen TUI could accept another normal prompt while the current session was still busy. That path sent session.prompt immediately, but the runner does not start ordinary new work while a run is already active, so the typed prompt could appear accepted while not actually running next.

This changes the TUI prompt behavior to snapshot normal prompts submitted during a busy session into a local queue. When the session transitions back to idle, it flushes one queued prompt. Pressing Esc with text in the prompt now queues that text before aborting the active response, so the latest user message is preserved and runs after the interrupt.

Shell mode keeps its existing behavior.

How did you verify your code works?

  • bun test --cwd packages/tui src/component/prompt/escape.test.ts src/component/prompt/queue.test.ts
  • bun run --cwd packages/tui typecheck
  • git diff --check

I also ran bun run --cwd packages/tui test. The package suite reached existing tests and failed on an unrelated Windows path expectation in test/runtime.test.tsx (~/project expected, ~\project received).

Screenshots / recordings

No recording. This is a TUI behavior change covered by the queue/escape unit tests.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

After shell command any queued prompt is not executed

1 participant