Skip to content

Cloud Mode: warn on shell-command first query and recover from Ctrl-C state [REMOTE-1533]#9496

Draft
warp-dev-github-integration[bot] wants to merge 1 commit intomasterfrom
oz-agent/REMOTE-1533-cloud-mode-fixes
Draft

Cloud Mode: warn on shell-command first query and recover from Ctrl-C state [REMOTE-1533]#9496
warp-dev-github-integration[bot] wants to merge 1 commit intomasterfrom
oz-agent/REMOTE-1533-cloud-mode-fixes

Conversation

@warp-dev-github-integration
Copy link
Copy Markdown

Description

Two Cloud Mode UX fixes from user feedback in REMOTE-1533:

1. Warning toast when the first query is a shell command

When composing the first query for a cloud agent run in V1 cloud mode (without CloudModeInputV2) with the input switched to shell mode, submitting silently fell through to the shell-execution path on the deferred cloud-mode terminal that has no PTY to run against. The user got no signal that nothing happened.

Now we surface a clear error toast (“Cloud agent conversations need an AI prompt as the first query…”) and short-circuit the submission instead. Implemented as a new should_warn_cloud_mode_first_query_must_be_ai helper on Input and a new else if branch in input_enter between the existing should_block_cloud_mode_setup_submission guard and the AI/shell branches.

2. Recover from the broken state after Ctrl-C during startup

After Ctrl-C during cloud agent startup the model transitions to Status::Cancelled (and the same broken state applies for Failed / NeedsGithubAuth pre-first-exchange). Re-entering the conversation by clicking the parent terminal’s blocklist entry block left the view in a half-broken layout: the cloud-mode v2 composing input only renders for Status::Composing, so the regular block list + input chrome takes over against a deferred terminal session that has nothing to run.

The fix adds AmbientAgentViewModel::reset_to_composing_after_terminal_state which resets the run back to Composing (clearing task_id, conversation_id, the queued-prompt + harness-started flags, and request) while preserving the user's environment and harness selections. The AmbientAgentEntryBlockAction::OpenAmbientAgent handler calls it before pushing the cloud-mode terminal view back onto the pane stack, so the user lands on a usable composer ready to dispatch a fresh run.

Testing

  • cargo fmt -- --check and cargo clippy -p warp --all-targets --tests -- -D warnings both pass cleanly.
  • Workspace-wide cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings could not be run end-to-end in this sandbox because libclang is not installed; the warp package's clippy check passed cleanly which covers all changed files.
  • Manual verification will need to confirm:
    • In V1 cloud-mode composing, switching the input to shell mode and pressing Enter shows the new error toast and does not execute anything.
    • Cancelling a cloud agent during startup, returning to the parent terminal, and clicking the blocklist entry block lands the user back on the cloud-mode composer with the previously selected environment and harness still in place.

Server API dependencies

This change does not depend on any server API changes.

Agent Mode

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

Changelog Entries for Stable

CHANGELOG-BUG-FIX: Cloud Mode: warn when the first query in a cloud agent run is a shell command, and recover the composer when re-entering a cancelled cloud conversation.

Conversation: https://staging.warp.dev/conversation/c07c27bf-dc85-46a7-ab48-76959ba08fea
Run: https://oz.staging.warp.dev/runs/019ddb0d-c830-790a-b6f7-f544fad95e94

This PR was generated with Oz.

… state [REMOTE-1533]

Two Cloud Mode UX fixes from user feedback in REMOTE-1533:

1. Warn when the first query for a cloud agent is a shell command. When
   composing a cloud agent run in V1 cloud mode (without CloudModeInputV2)
   with the input switched to shell mode, submitting would silently fall
   through to the shell-execution path on the deferred cloud-mode terminal
   that has no PTY to run against. Now surface a toast that tells the user
   the first query in a cloud conversation must be an AI prompt and short
   circuits submission.

2. Recover from the broken state when re-entering a cancelled cloud
   conversation via the parent terminal's blocklist entry. After Ctrl-C
   during cloud agent startup the model lands in Status::Cancelled
   (similarly Failed / NeedsGithubAuth pre-first-exchange). Re-entering
   then leaves the view in a half-broken layout because the cloud-mode-v2
   composing input only renders for Status::Composing, so the regular
   block list and input chrome take over against a deferred terminal
   session that has nothing to run. Reset the model back to Composing
   while preserving the user's environment and harness selections so the
   composer is usable again, ready to dispatch a fresh run.

CHANGELOG-BUG-FIX: Cloud Mode: warn when the first query in a cloud agent run is a shell command, and recover the composer when re-entering a cancelled cloud conversation.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 29, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: {"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/users/users#get-the-authenticated-user&quot;,&quot;status&quot;:&quot;403&quot;}.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants