Skip to content

Make /environment slash command available in & handoff compose mode#11039

Closed
harryalbert wants to merge 2 commits into
masterfrom
harry/environment-slash-command-for-handoff
Closed

Make /environment slash command available in & handoff compose mode#11039
harryalbert wants to merge 2 commits into
masterfrom
harry/environment-slash-command-for-handoff

Conversation

@harryalbert
Copy link
Copy Markdown
Contributor

Description

Makes the /environment slash command available in the & handoff compose mode, not just the V2 cloud-mode composing input.

Previously, /environment was gated on CLOUD_AGENT_V2 availability, which is only set for the V2 cloud-mode data source. The handoff compose mode (&) explicitly opts out of V2 composing, so /environment was never shown there. Users had to use the footer environment chip to switch environments during handoff compose.

Changes:

  • Removed CLOUD_AGENT_V2 from /environment's availability flags (now AGENT_VIEW | AI_ENABLED)
  • Added handoff_compose_state to SlashCommandDataSource so it can track when handoff is active
  • Added a custom command_is_active_in_context check that requires either CLOUD_AGENT_V2 or active handoff compose for /environment
  • Updated the /environment execution handler to open the handoff environment selector (instead of the V2 one) when handoff compose is active
  • Added open_handoff_environment_selector to Input and AgentInputFooter

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • I have manually tested my changes locally with ./script/run

Agent Mode

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

CHANGELOG-NONE


Conversation: https://staging.warp.dev/conversation/243232a0-a86b-4776-be28-4dea0996b05a
Run: https://oz.staging.warp.dev/runs/019e2d12-bf61-7d71-9e58-1e01229b18dd
This PR was generated with Oz.

The /environment command was previously gated on CLOUD_AGENT_V2
availability, restricting it to only the V2 cloud-mode composing input.
This change makes it also available during handoff compose (& mode) by:

- Removing CLOUD_AGENT_V2 from /environment's availability flags
- Adding handoff compose state tracking to the slash command data source
- Gating /environment on either V2 cloud mode or active handoff compose
- Opening the handoff environment selector when in handoff mode

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 15, 2026
clear_buffer_and_reset_undo_stack explicitly calls exit_cloud_handoff_compose,
which tears down the handoff state before the environment selector can open.
In handoff mode, only clear the editor text directly instead.

Co-Authored-By: Oz <oz-agent@warp.dev>
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.

1 participant