Local-to-Cloud Handoff
Promote an interactive local agent session mid-task to a detached cloud agent that keeps running after the developer disconnects and reports back asynchronously.
Context
A developer is driving an agent interactively from a laptop or terminal, refining a plan turn by turn. At some point the work becomes long-running and self-contained: a refactor, a test-fixing loop, a multi-step build that will take minutes or hours and no longer needs steering. The developer wants to close the laptop, switch tasks, or go offline without abandoning or restarting the run.
Problem
An interactive session is tied to the developer's presence: the process lives in a terminal or editor on the local machine, so disconnecting, sleeping the laptop, or losing the network stalls or kills the run. Keeping the machine awake and tethered for hours wastes the developer's time on a task that no longer needs input, while killing and re-prompting on a fresh remote agent loses the accumulated plan, context, and partial progress built up during the interactive phase.
Forces
- Long autonomous runs do not need a human watching, but starting them fresh elsewhere discards local context.
- The developer's presence and the agent's execution are coupled when the session lives in a local process.
- Transferring an in-flight session must carry plan, conversation history, and working state, not just a prompt.
- Cloud execution needs its own credentials, repo access, and sandbox that the local machine implicitly had.
- A detached run that goes wrong must still surface to the developer rather than fail silently.
Example
A developer is iterating with a local CLI agent on a large dependency upgrade and, once the plan is settled, prepends a marker to send the conversation to a cloud agent. The laptop closes; the cloud agent clones the repo, finishes the upgrade and test loop in its own VM, and pushes a branch. A notification arrives an hour later, and the developer reviews the diff on the web without the session ever having been local-bound.
Diagram
Solution
Therefore:
Expose an explicit handoff action in the interactive session (a command, prefix, or button) that snapshots the current state and transfers it to a cloud agent runtime. The cloud runtime clones or mounts the repository, restores the plan and conversation context, and resumes the run autonomously in its own sandbox with its own credentials. The local client detaches: the developer can disconnect, and the run survives. On completion or when input is required, the cloud agent notifies the developer out of band and offers a way to reattach, review the diff, or pull the run back to local. The defining move is decoupling execution from the local interactive session so it outlives disconnect; this is distinct from agent-to-agent control transfer and from resuming a previously saved session.
What this pattern forbids. Execution must continue independently of the local interactive session once handed off, and the cloud agent must notify the developer rather than block silently when it completes or needs input.
And the patterns that stand alongside it, or against it —
- complementsHandoff★— Transfer the active conversation from one agent to another, carrying context across the switch.
- complementsAgent Resumption★★— Persist agent execution state so a long-running run survives restarts, deploys, or user disconnects.
- complementsScheduled Agent★★— Run the agent on a fixed schedule independent of user requests.
Neighbourhood
Click any neighbour to follow the language. Scroll to zoom, drag to pan.