5.7 KiB
5.7 KiB
/queue Slash Command & Auto-Queue Toggle
Linear: APP-4041 Figma: none provided
Summary
Two complementary features for queuing follow-up prompts while the agent is responding:
/queue <prompt>— a slash command that queues a specific prompt.- Auto-queue toggle — a status bar button (and keyboard shortcut) that causes the next regular input submission to be queued instead of sent immediately.
When the agent finishes, the queued prompt is automatically sent to the same conversation.
Problem
When the agent is mid-response the user often already knows what they want to ask next, but they have to wait for the agent to finish before they can type and send it. This breaks flow and wastes time.
Goals
- Let users queue exactly one follow-up prompt while the agent is busy.
- Provide visual feedback that a prompt is queued and will be sent automatically.
- Let users cancel the queued prompt before it fires.
- Automatically send the queued prompt when the agent finishes successfully; gracefully handle failures.
Non-goals
- Queuing multiple prompts in sequence (only one at a time).
- Providing a persistent prompt queue that survives app restart.
User Experience
Invoking /queue
- The command is
/queue <prompt>and appears in the slash command menu when theQueueSlashCommandfeature flag is enabled (dogfood). - The prompt argument is required;
/queuewith no argument shows an error toast. - The command is only available when the user is in an agent view with an active conversation.
- If the agent is currently responding (in-progress or blocked), the prompt is queued and the input buffer is cleared.
- If the agent is idle (conversation finished), the prompt is sent immediately — same as typing it and pressing enter.
Auto-queue toggle
- A toggle button appears in the warping indicator (status bar) when the agent is responding, gated behind
QueueSlashCommand. - The button uses a
ClockPlusicon; when active the icon is accent-colored, otherwise disabled-colored. - Keyboard shortcut:
Cmd+Shift+J(Mac) /Ctrl+Shift+J(Linux/Windows). - When the toggle is on and the user submits any input (regular prompt, slash command, or skill command) while the conversation is in progress, the input is queued instead of sent immediately.
- The toggle persists across exchanges in the same conversation (same semantics as fast-forward / auto-approve).
Pending query indicator
- A "pending user query" block appears at the bottom of the blocklist showing:
- The user's avatar and display name.
- The queued prompt text (dimmed, bold).
- A "Queued" badge (italic, smaller font).
- A dismiss button (X icon) in the top-right corner with a "Remove queued prompt" label.
- A "Send now" button (Play icon) when the queued prompt is interruptible (i.e. from
/queueor auto-queue, but not from summarization-triggered queuing like/compact-and).
- The pending block is gated behind the
PendingUserQueryIndicatorfeature flag (dogfood).
Dismissal
- Clicking the dismiss button (X) removes the pending query block and cancels the queued prompt — it will not be sent.
- Clicking the "Send now" button removes the pending query block and immediately submits the queued prompt, interrupting the in-progress conversation.
- Exiting the agent view while a prompt is queued also cancels it.
Auto-send behavior
- When the agent finishes successfully (
FinishReason::Complete), the queued prompt is re-submitted through the normal input flow (so slash commands, skill commands, and session sharing are all handled correctly). - When the agent finishes with an error, cancellation, or cancelled-during-command-execution, the queued prompt is placed back into the input buffer (so the user doesn't lose it) instead of being sent.
Interaction with other commands
- Both
/queueand the auto-queue toggle reuse the samesend_user_query_after_next_conversation_finishedmechanism as/compact-andand/fork-and-compact, meaning only one queued prompt can exist at a time (the latest one wins).
Success Criteria
/queue fix the testsqueues the prompt, shows the pending indicator, and auto-sends "fix the tests" once the agent finishes./queuewith no argument shows an error toast and does not clear the input./queuewhen the agent is idle sends the prompt immediately./queuewhen there is no active conversation shows an error toast.- Clicking the dismiss X removes the pending block and prevents the prompt from sending.
- If the agent errors or is cancelled, the prompt text is restored to the input buffer.
- The
active_ai_blockandlast_ai_blockhelpers correctly skip over the pending query block (same as they skip usage footers). - Auto-queue toggle: toggling on and submitting during an in-progress conversation queues the prompt.
- Auto-queue toggle: toggle state persists across exchanges until the user explicitly toggles it off.
Validation
- Manual: invoke
/queueduring an in-progress conversation, verify indicator appears and prompt auto-sends on completion. - Manual: invoke
/queuethen dismiss, verify prompt does not send. - Manual: invoke
/queuethen cancel the agent, verify prompt is placed in input buffer. - Manual: invoke
/queuewhen agent is idle, verify prompt is sent immediately. - Manual: invoke
/queuewith no argument, verify error toast. - Manual: toggle auto-queue on, type a prompt and press enter during in-progress conversation, verify it queues.
- Manual: verify auto-queue toggle persists after a queued prompt is sent.
- Code review: verify
active_ai_blockandlast_ai_blockskipis_pending_user_query()entries.