Skip to content

Skip auto-handoff-on-sleep for orchestrator sessions with local child agents#13211

Open
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
factory/auto-handoff-skip-orchestrator
Open

Skip auto-handoff-on-sleep for orchestrator sessions with local child agents#13211
warp-dev-github-integration[bot] wants to merge 1 commit into
masterfrom
factory/auto-handoff-skip-orchestrator

Conversation

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor

Description

When auto-handoff-on-sleep is enabled, an in-progress, synced orchestrator session was auto-handed-off to the cloud on sleep just like any other session. That forks only the parent to the cloud and orphans its still-running local child agents.

This adds a new AutoCloudHandoffSkipReason::OrchestratorWithLocalChildren skip, computed by a new has_local_orchestrated_children topology helper (any descendant that is a local — !is_remote_child() — and active — !ConversationStatus::is_done() — child). It is wired through the shared AutoCloudHandoffEligibility::skip_reason, so it covers all automatic handoff triggers (MacOsSleep and Uri) and also suppresses the misleading wake "you could hand this off" discoverability prompt for these sessions. User-initiated manual handoff is unaffected.

Requested in the factory-client triage thread (spec approved by the reporter): https://warpdev.slack.com/archives/C0BCE7AELJ2/p1782779637596289?thread_ts=1782779637.596289&cid=C0BCE7AELJ2

Linked Issue

N/A — requested via the factory-client Slack triage thread linked above.

Testing

  • Added regression test auto_handoff_skips_orchestrator_with_local_children in app/src/workspace/auto_handoff_tests.rs (fails to compile before the change; passes after) plus a no-regression assertion that the default eligible session still returns None.
  • Added topology unit tests has_local_orchestrated_children_detects_active_local_children (active local child counts; finished child does not; no children does not) and has_local_orchestrated_children_ignores_remote_children.
  • ./script/format clean; cargo clippy -p warp --all-targets --tests -- -D warnings passes; targeted cargo nextest run -p warp auto_handoff orchestrat → 201 passed.
  • Not user-visible (this only skips a background handoff), so there is no UI surface to drive. The MacOsSleep trigger is gated on a macOS sleep event and isn't reproducible on the Linux CI runner; logic is covered by the unit tests above. A macOS reviewer can optionally confirm end-to-end via the warp://.../auto_handoff_to_cloud debug URI / actual sleep.

Agent Mode

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

When auto-handoff-on-sleep is enabled, an in-progress synced orchestrator
session was auto-handed-off to the cloud on sleep like any other session,
forking only the parent and orphaning its local child agents.

Add an OrchestratorWithLocalChildren skip reason, computed via a new
has_local_orchestrated_children topology helper (active, non-remote
descendants), wired through the shared AutoCloudHandoffEligibility check so
it covers all automatic handoff triggers and also suppresses the misleading
wake discoverability prompt for these sessions.

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@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

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR adds an auto-handoff skip reason for orchestrator sessions with active local child agents, threads that check through automatic handoff eligibility, and adds regression coverage for the topology helper and eligibility decision.

Concerns

  • This changes user-perceivable auto-handoff behavior and suppresses the wake discoverability prompt, but the PR description does not include screenshots or a screen recording demonstrating the behavior end to end. Please attach visual evidence from a local desktop run or a computer-use-enabled environment; the debug URI can cover the automatic handoff path if macOS sleep itself is hard to trigger.

Verdict

Found: 0 critical, 1 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

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

Thanks for the review. On the request for visual evidence: this change has no positive UI surface to screenshot — it only changes an internal auto-handoff eligibility decision. Its two user-perceivable effects are both conditional absences that aren't faithfully reproducible in this Linux CI/cloud environment:

  1. No "Handed session off to the cloud" toast for an orchestrator session on sleep. Capturing this requires staging a real in-progress, server-synced multi-agent session with an active local child and then performing a live production cloud-fork handoff — the toast only appears on a successful real fork. That's a production side effect, not something I can stage as a faithful screenshot here.
  2. Suppressed wake discoverability modal. That modal is only recorded/shown on the macOS sleep→wake path (SystemStatsEvent::CpuWillSleep / CpuWasAwakened), which does not fire on the Linux runner, so it cannot be exercised here at all.

Because of that, the decision is verified deterministically at the exact boundary with unit tests rather than a screenshot:

  • auto_handoff_skips_orchestrator_with_local_children — an otherwise-eligible session with the orchestrator-children flag returns Some(OrchestratorWithLocalChildren) (and the default eligible session still returns None).
  • has_local_orchestrated_children_detects_active_local_children and has_local_orchestrated_children_ignores_remote_children — exercise the real detection helper against real AIConversations (active local child ⇒ skip; finished child ⇒ no skip; remote child ⇒ no skip; no children ⇒ no skip).

./script/format, cargo clippy -p warp --all-targets --tests -- -D warnings, and the targeted warp tests are green. I did build and launch the signed-in dogfood client to confirm it runs, but a faithful end-to-end capture would require a real cloud fork and (for the modal) macOS sleep, neither available here. A reviewer on macOS can confirm end-to-end locally via the warp://action/auto_handoff_to_cloud debug URI on an orchestrator session.

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