warp icon indicating copy to clipboard operation
warp copied to clipboard

Run /fork (and other action slash commands) immediately in queued-prompts mode

Open warp-agent-staging opened this issue 5 months ago • 3 comments

Description

When queued-prompts mode is enabled and a conversation is in progress, submitting an action-emitting slash command like /fork captured it as a queued prompt (it showed up as a literal /fork row in the queue) instead of running immediately. This is wrong: /fork doesn't add an input to the current conversation — it emits an action (forking into a new pane/tab).

Root cause: in app/src/terminal/input.rs, the Enter submit chain runs maybe_queue_input_for_in_progress_conversation before the slash-command executor, and while a conversation is in progress with queueing enabled it appended the whole buffer to the queue, special-casing only /queue.

This PR makes action-emitting slash commands bypass prompt queuing and run immediately, while keeping the prompt-submitting commands queued.

What changed

  • Added a centralized classifier slash_command_is_submitted_as_prompt in slash_commands/mod.rs — the single source of truth for which slash commands reiterate their text into the conversation as an AI prompt (/compact, /plan, /orchestrate) versus emit an immediate local action (everything else). The command_that_just_sends_ai_request_with_prefix arm in execute_slash_command now uses it too, so the list lives in one place.
  • maybe_queue_input_for_in_progress_conversation now bypasses the queue for detected action-emitting slash commands (e.g. /fork, /model, /rewind), letting them fall through to the slash-command executor. /queue keeps its existing dedicated handling; /compact//plan//orchestrate and skills are still queued.
  • Per reviewer request, the prior art in submit_viewer_ai_query (which hardcoded /fork + /fork-and-compact to run locally on the viewer's machine instead of forwarding to the sharer) now routes through the same classifier, centralizing the "handled immediately vs reiterated as a prompt" decision.

Note on long-running commands

While an agent controls a long-running command (LRC), /fork is intentionally unavailable (gated by NO_LRC_CONTROL), so it is not detected as a command in that state and is unaffected by this change. The fix targets the normal in-progress (streaming response) state where /fork is available, which is the reported scenario.

Linked Issue

Reported in the factory-client bug-triage Slack thread (linked below). No GitHub issue.

  • [x] Where appropriate, screenshots or a short video of the implementation are included below.

Testing

  • Added unit test slash_command_is_submitted_as_prompt_only_for_prompt_commands (classifier correctness: only /compact//plan//orchestrate are prompts; /fork, /fork-and-compact, /fork-from, /continue-locally, /compact-and, /model, /rewind, /conversations, /queue are not).

  • Added integration tests in input_tests.rs:

    • slash_fork_bypasses_prompt_queue_while_in_progress — with an in-progress conversation and queue mode on, /fork is NOT added to the queue.
    • slash_compact_still_queues_while_in_progress — /compact is still queued, so the bypass is scoped to action commands only.
  • All three new tests pass (cargo nextest run -p warp ...). cargo clippy -p warp --tests is clean.

  • Manual verification by building and running Warp and driving it with computer use: with queue mode ON during a normal streaming response, typing /fork + Enter forks the conversation into a new side-by-side pane (it is NOT queued), while a plain prompt ("tell me a joke") is still added to the "1 queued" panel. See below.

  • [x] I have manually tested my changes locally

Screenshots / Videos

Verified via computer use on a local build (queued-prompts mode ON, agent actively streaming a response).

/fork runs immediately — forks into a new side-by-side pane instead of being queued:

/fork forks immediately in queued-prompts mode

Control — a plain follow-up prompt is still queued ("1 queued"):

plain prompt still queues

Agent Mode

  • [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Slash commands that emit an action (like /fork) now run immediately instead of being captured as a queued prompt when queued-prompts mode is on.

Conversation: https://staging.warp.dev/conversation/9f4d9c88-9146-4841-bf32-c0c6e9f83fd4 Run: https://oz.staging.warp.dev/runs/019eff55-5238-7a84-924c-bf2f190ed677

This PR was generated with Oz.

warp-agent-staging avatar Jun 25 '26 20:06 warp-agent-staging

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

warp-for-oss[bot] avatar Jun 25 '26 20:06 warp-for-oss[bot]

Addressed the review feedback (visual evidence): the Screenshots / Videos section of the PR description now embeds a screen capture demonstrating the end-to-end behavior with queued-prompts mode enabled:

  • /fork runs immediately and forks the conversation into a new side-by-side pane (it is not queued).
  • Control: a plain follow-up prompt in the same state is still queued ("1 queued").

These were captured by building and running Warp and driving it via computer use during a live streaming agent response. The behavior is also covered by automated tests (slash_fork_bypasses_prompt_queue_while_in_progress, slash_compact_still_queues_while_in_progress, and the classifier unit test). Re-requesting review.

warp-agent-staging avatar Jun 25 '26 21:06 warp-agent-staging

/oz-review

warp-agent-staging avatar Jun 25 '26 21:06 warp-agent-staging