Skip to content

Add AmbientSetupPhaseEnded variant to OrderedTerminalEventType#17

Merged
harryalbert merged 3 commits into
mainfrom
harry/empty-prompt-handoff-local
May 28, 2026
Merged

Add AmbientSetupPhaseEnded variant to OrderedTerminalEventType#17
harryalbert merged 3 commits into
mainfrom
harry/empty-prompt-handoff-local

Conversation

@harryalbert
Copy link
Copy Markdown
Contributor

@harryalbert harryalbert commented May 22, 2026

Add AmbientSetupPhaseEnded variant to OrderedTerminalEventType

In this PR, we make it so that users can kick off new cloud agent runs (specifically for local to cloud handoff) with no prompt.

One issue that this presented was that we rely on the initial agent response coming in to indicate to cloud agent viewers that the setup phase is complete. Without this event, the user is just stuck in the "Environment setup..." phase forever, meaning the client blocks them from submitting prompts (and the UI is generally borked).

To fix this, we need a prompt-agnostic event to indicate to viewers that environment setup is complete. The sharer emits this after setup is over (before sending the prompt for the start of the session, or not sending it if there's no prompt).

Co-Authored-By: Oz oz-agent@warp.dev

harryalbert and others added 2 commits May 22, 2026 16:50
Adds an explicit shared-session-protocol marker that the sandboxed Oz
AgentDriver emits when cloud-mode setup is complete but no initial LLM
turn will follow (e.g. empty-prompt local-to-cloud handoff with
`--skip-initial-turn`). Viewers consume the event to tear down the
Cloud Mode Setup V2 "Running setup commands..." chip and clear
`BlockList::is_executing_oz_environment_startup_commands` without
waiting for the first `AppendedExchange`.

The variant is unit-typed (no associated data) for v1. A future struct
upgrade with `task_id: Option<String>` is fine to plan for as a struct
variant later but is deliberately out of scope here.

Mirrors the placement and idiom of the adjacent
`AgentConversationReplayStarted` / `AgentConversationReplayEnded`
variants. The session-sharing-server treats `OrderedTerminalEventType`
opaquely (only `CommandExecutionFinished` is special-cased for
block-id tracking), so no server code changes are required to route or
persist the new variant. The server will pick it up via a protocol
dep rev bump after this change merges.

Includes a serde round-trip test asserting the unit-variant wire form.

Stage 2c of empty-prompt local-to-cloud handoff.

Co-Authored-By: Oz <oz-agent@warp.dev>
… missing Started half

Adjacent variants come in Started/Ended pairs; AmbientSetupPhaseEnded has no matching Started because the setup-phase start is implicit in existing SetupCommandState transitions on the viewer once scrollback arrives.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 22, 2026
Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link
Copy Markdown

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

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

Looks good overall! Exteme nit to rename this CloudModeSetupPhaseEnded but totally optional since I know you'll have to shuffle around the other PR.

Copy link
Copy Markdown
Contributor Author

Looks good overall! Exteme nit to rename this CloudModeSetupPhaseEnded but totally optional since I know you'll have to shuffle around the other PR.

​with orchestration any shuffling is possible lol. I'll update

Co-Authored-By: Oz <oz-agent@warp.dev>
@harryalbert harryalbert merged commit c2226e8 into main May 28, 2026
6 checks passed
@harryalbert harryalbert deleted the harry/empty-prompt-handoff-local branch May 28, 2026 14:26
harryalbert added a commit to warpdotdev/warp that referenced this pull request Jun 3, 2026
…on click) (#11576)

## Description
<!-- Please remember to add your design buddy onto the PR for review, if
it contains any UI changes! -->

Building off of the changes from the PR below this one in the stack, we
now want to change all of the client handoff surfaces to allow for
handing off without a prompt (and to take advantage of this instant
handoff flow).

Specifically, we change it so that:
* clicking the handoff chip (when the prompt is empty) automatically
kicks off handoff
* if the conversation is in progress when handing off, a "continue"
prompt is auto-inserted so the agent continues its work stream in the
cloud
* if the conversation has some snapshots to restore, a prompt is
inserted to do snapshot restoration. Otherwise, we would skip snapshot
restoration entirely (or do it without a user visible prompt)
   * if neither of these are true, we just handoff with no prompt
* typing /handoff with no prompt also automatically kicks off handoff
(with the same prompt semantics as above)
* We listen for the new `AmbientSetupPhaseEnded` session sharing message
from [this
PR](warpdotdev/session-sharing-protocol#17) to
exit the environment setup phase, removing our dependency on a prompt
event to do this.

## Testing
<!--
How did you test this change? What automated tests did you add? If you
didn't add any new tests, what's your justification for not adding any?

Manual testing is required for changes that can be manually tested, and
almost all changes can be manually tested. If your change can be
manually tested, please include screenshots or a screen recording that
show it working end to end.

You can run the app locally using `./script/run` - see WARP.md for more
details on how to get set up.
-->

- [x] I have manually tested my changes locally with `./script/run`

### Screenshots / Videos
<!-- Attach screenshots or a short video demonstrating the change, where
appropriate. Remove this section if it is not relevant to your PR. -->

https://www.loom.com/share/e748b81a3e22418f9e9836acf56c06c1

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

---------

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.

2 participants