Skip to content

Queue slash and shell prompts in the TUI#18542

Merged
etraut-openai merged 3 commits intomainfrom
etraut/queue-slash
Apr 19, 2026
Merged

Queue slash and shell prompts in the TUI#18542
etraut-openai merged 3 commits intomainfrom
etraut/queue-slash

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented Apr 19, 2026

Why

Users have asked to queue follow-up slash commands while a task is running, including in #14081, #14588, #14286, and #13779. The previous TUI behavior validated slash commands immediately, so commands that are only meaningful once the current turn is idle could not be queued consistently.

The queue should preserve what the user typed and defer command parsing until the item is actually dispatched. This also gives /fast, /review ..., /rename ..., /model, /permissions, and similar slash workflows the same FIFO behavior as plain queued prompts.

What Changed

  • Added a queued-input action enum so queued items can be dispatched as plain prompts, slash commands, or user shell commands.
  • Changed Tab queueing to accept slash-led prompts without validating them up front, then parse and dispatch them when dequeued.
  • Added ! shell-command queueing for Tab while a task is running, while preserving existing Enter behavior for immediate shell execution.
  • Moved queued slash dispatch through shared slash-command parsing so inline commands, unavailable commands, unknown commands, and local config commands report at dequeue time.
  • Continued queue draining after local-only actions and after slash menu cancellation or selection when no task is running.
  • Preserved slash-popup completion behavior so /mo<Tab> completes to /model instead of queueing the prefix.
  • Updated pending-input preview snapshots to show queued follow-up inputs.

Verification

I did a bunch of manual validation (and found and fixed a few bugs along the way).

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 550ffdfff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/chatwidget.rs
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also tested and worked perfectly.

Approved.

@etraut-openai etraut-openai merged commit 917a85b into main Apr 19, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/queue-slash branch April 19, 2026 17:52
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants