Add sleep auto handoff to cloud#11049
Conversation
|
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 Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds a macOS sleep-triggered automatic local-to-cloud handoff path, a settings toggle, and a warplocal://action/auto_handoff_to_cloud trigger. The core flow is integrated with the existing handoff implementation, but there are blocking correctness and privacy issues before merge.
Concerns
- The user-facing settings change has no screenshot or recording attached, which is required for visual/UI changes.
- The new last-focused conversation accessor can return stale data when the focused pane changes conversations without a focus change, which can cause auto handoff to validate/mark one conversation while handing off another.
Security
- The new setting defaults automatic cloud handoff on for existing eligible users, which can fork local conversations and upload workspace snapshots on sleep without an explicit opt-in to this new automatic behavior.
- The URI trigger bypasses the new auto-handoff opt-out, allowing
warplocal://action/auto_handoff_to_cloudto initiate the same cloud handoff even after the user disables the sleep setting.
Verdict
Found: 0 critical, 4 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
f0a1e51 to
88ecf8a
Compare
harryalbert
left a comment
There was a problem hiding this comment.
Very cool change. Just had a few thoughts/comments.
Also, just to double-check, this doesn't auto-cancel cloud conversations if they're focused, right (from the code it looks like it doesn't but just wanted to make sure)?
| ctx: &mut ModelContext<Self>, | ||
| ) { | ||
| match event { | ||
| SystemStatsEvent::CpuWillSleep => { |
There was a problem hiding this comment.
I'm a little concerned about using this event as the trigger for handoff, just because handoff involves some async processes that could take a while and might not reliably trigger before the computer shuts down.
I'm not sure if there's a great way to fix this reliably, but I'm curious if you ran into it when testing this feature w/ longer conversations that might have taken longer to hand off
There was a problem hiding this comment.
Yeah, it's a good call out. I'm hoping some of the work on improving speed for handoff would be a potential fix here. I will do some research on a better solution, but it does have a 30s buffer.
88ecf8a to
7a348fe
Compare
Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
harryalbert
left a comment
There was a problem hiding this comment.
Approving to unblock, but had a few more comments that would be good to address before merging
7a348fe to
932ba2e
Compare
|
@dplakon had the agent take a look, and it had one other comment that I also think is worth addressing: |
## Description Adds a macOS-only **Auto handoff on sleep** setting under Warp Agent → Cloud Handoff. When enabled, Warp listens for macOS sleep events and attempts to hand off the last-focused eligible local Warp Agent session to Cloud Mode using the existing local-to-cloud handoff flow. This also adds a `warplocal://action/auto_handoff_to_cloud` trigger for testing and hook-driven invocation; the trigger now respects the same **Auto handoff on sleep** opt-in setting. The setting defaults to off so existing users do not silently enable automatic cloud handoff or workspace snapshot upload. https://github.com/user-attachments/assets/38161805-065a-49b4-a4e6-18403de5b0a1 <img width="906" height="238" alt="Screenshot 2026-05-15 at 5 06 56 PM" src="https://github.com/user-attachments/assets/ccf951e4-3749-4add-a30f-868af3f41183" /> ## Linked Issue No linked issue. - [ ] The linked issue is labeled `ready-to-spec` or `ready-to-implement`. - [x] Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes). ## Testing - [x] `cargo fmt` - [x] `cargo clippy --workspace --all-targets --all-features --tests -- -D warnings` - [x] `cargo nextest run -p warp auto_handoff --no-fail-fast` — 13 passed - [x] `cargo nextest run -p warp last_focused_terminal_tracks_most_recent_globally conversation_switch_updates_last_focused_terminal_state --no-fail-fast` — 2 passed - [x] `git --no-pager diff --check origin/master...HEAD` - [x] Manual smoke test with `./script/run --open_with_launchd` and `warplocal://action/auto_handoff_to_cloud` in the original implementation checkout - [x] I have manually tested my changes locally with `./script/run` ### Screenshots / Videos Not included in this update. The PR now notes the setting is opt-in and the URI trigger respects that opt-in; please attach UI media from a local app session if required for review. ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode CHANGELOG-OZ: Added a macOS setting to automatically hand off active local Warp Agent sessions to Cloud Mode before sleep. Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
Description
Adds a macOS-only Auto handoff on sleep setting under Warp Agent → Cloud Handoff.
When enabled, Warp listens for macOS sleep events and attempts to hand off the last-focused eligible local Warp Agent session to Cloud Mode using the existing local-to-cloud handoff flow. This also adds a
warplocal://action/auto_handoff_to_cloudtrigger for testing and hook-driven invocation; the trigger now respects the same Auto handoff on sleep opt-in setting.The setting defaults to off so existing users do not silently enable automatic cloud handoff or workspace snapshot upload.
davinci_the_scene_starts_with_a_slightly_ajar_laptop__the_.mp4
Linked Issue
No linked issue.
ready-to-specorready-to-implement.Testing
cargo fmtcargo clippy --workspace --all-targets --all-features --tests -- -D warningscargo nextest run -p warp auto_handoff --no-fail-fast— 13 passedcargo nextest run -p warp last_focused_terminal_tracks_most_recent_globally conversation_switch_updates_last_focused_terminal_state --no-fail-fast— 2 passedgit --no-pager diff --check origin/master...HEADManual smoke test with
./script/run --open_with_launchdandwarplocal://action/auto_handoff_to_cloudin the original implementation checkoutI have manually tested my changes locally with
./script/runScreenshots / Videos
Not included in this update. The PR now notes the setting is opt-in and the URI trigger respects that opt-in; please attach UI media from a local app session if required for review.
Agent Mode
CHANGELOG-OZ: Added a macOS setting to automatically hand off active local Warp Agent sessions to Cloud Mode before sleep.
Co-Authored-By: Oz oz-agent@warp.dev