Skip to main content
Some jobs are not one request. You ask for something, look at what came back, go to lunch, and ask for the next piece. In between, the workspace may have been paused and its computer released. What you build here: a session you can come back to. The conversation does not restart, the files are still there, and the second round knows what the first one did.

Before you start

A token and a model, as in the quickstart. Nothing else — continuity is the default, not a feature you turn on.

The whole thing

Nothing in round two restates round one. “That API” means something to the agent because the transcript lives in the control plane, not in the workspace — so releasing the computer costs you nothing but the time to wake it.

Watch it, don’t poll it

Record the last id: you saw. Only durable events carry one. See Showing the agent’s work for what else is on this stream.

Reconnect where you left off

Connections drop. Pass the last id you saw:
You get every durable event after that point, then live frames again. The cursor always names a row that exists, so resuming is exact rather than approximate — you do not have to reconcile against items afterwards. You will miss the typing animation from the gap. You will not miss anything that happened: agent.text is a transient stream of deltas, and its settled form agent.message is durable and replayed.

Let it go idle

Do nothing for a while. The workspace pauses:
The filesystem is snapshotted. The computer stops costing you anything.

Come back and say the next thing

No resume call, no replaying history, no re-explaining. Sending the message wakes the workspace, and “that API” means something to the agent because the transcript was never in the workspace to begin with.

Check that it really remembered

Both rounds appear as one continuous record.

You have it working when

  • The second round lands without you restating anything, and the reply refers to what was built in the first
  • environment.state went running → paused → running on its own
  • items is continuous across both rounds
  • After reconnecting with last_event_id, the events you receive are strictly increasing and none are repeated

What to know

A workspace lives two hours. That is the computer’s lifetime, not the turn’s — a single turn may run a long time. Work that spans days should be several sessions, with anything worth keeping written to /workspace/outputs so it becomes an artifact. Idle pause is a deployment setting. You cannot tune it per session. Snapshots restore files, not processes. A server the agent started is not running after a wake. Ask it to start the server again in the next turn. Artifacts outlive the workspace. Anything under /workspace/outputs is published when the turn settles and remains downloadable after the computer is gone.

When it goes wrong