Cloudflare Agents SDK v0.34.0 Parks Tools That Wait on You
Pi 1.6 lets an agent tool return sleep instead of a result, so the Durable Object hibernates while a human decides. Plus the breaking changes.

Cloudflare released Agents SDK v0.34.0 on November 20, 2026, upgrading PiHarness to Pi 1.6. The headline change: a tool can now park itself while it waits, and the Durable Object behind it hibernates.
That matters because of a bill. An agent that pauses for a human to click "Approve", or for a subagent to finish, used to keep a stateful serverless container or Durable Object awake the whole time — compute spent on waiting, with an execution timeout at the end of it.
What a parked tool actually does
In Pi 1.6, a tool's execute handler can return a sleep object naming target signals or a deadline instead of returning a final tool output. The session's overall run stays open, but no JavaScript invocation stays pinned in memory.
Waking it is one call: this.harness.signal(taskId, SignalDef, key, payload) wakes the Durable Object and re-runs the tool from the top with the delivered signal value. "From the top" is the part to design around — the handler runs again from its first line, so the documented pattern is to call api.readSignal(...) at the start and return the stored answer if one is already there. That keeps the tool idempotent and stops it firing a duplicate UI prompt on every wake.
Two more places the pattern applies
- Subagent coordination.
submit()andcontinue()now accept anotifyoption, so a parked parent tool wakes automatically when a child session settles. - Approval gates. A
beforeToolhook can park a tool call before it executes, which is how you enforce manual sign-off ahead of a destructive API call.
Pi 1.5 to Pi 1.6, line by line
| Capability | Pi 1.5 | Pi 1.6 (v0.34.0) |
|---|---|---|
| Waiting on a human or subagent | No parked tools; you write the state handling | Tool returns sleep; Durable Object hibernates |
| Signal delivery | (await harness.pi()).signal() | harness.signal() directly on PiHarness |
| Seeding a transcript | Manual post-create writes | init option on harness.root(), sessions.create(), sessions.fork() |
| Queued messages on abort | Follow-up input could be dropped on stop | submit(input, { onAbort: "keep" }) preserves them |
| HTTP and WebSocket errors | Error details returned in the response | Generic 500 / 1011 close unless you implement onFetchError() |
What breaks on upgrade
Three changes fail silently or throw at runtime if you skip them. Failed requests no longer leak internal error details: HTTP failures return a generic 500 and failed WebSocket upgrades close with code 1011, so a client UI that expects structured error payloads needs onFetchError() implemented explicitly.
MCP error handling is stricter. When an MCP server requires re-authentication the SDK throws MCPAuthorizationRequiredError carrying an error.authUrl link you are expected to surface to the user, and a failed MCP server stays failed until your code calls reconnectMcpServer(id) — no more silent retry loops against a broken server.
If you import @earendil-works/pi-durable directly, RunEndTask is now HookTask, and code mode namespaces come from Extension.namespace. On the model side, ai.image() and ai.images() now target FLUX.2 image models and claudeCode() defaults to claude-sonnet-5-5.
Quieter fixes worth the upgrade on their own
Chat stop, clear, regenerate and resume now synchronise across browser tabs and through Durable Object recovery, so hitting stop in one window while another streams no longer leaves orphaned state. Cloudflare also fixed a race where a schedule, queue item or Task run that had been cancelled or replaced could still execute again — the kind of bug that bills you twice. Pi now retries a wider set of dropped provider connections, and when Anthropic cannot continue an existing message thread, the SDK resends the full conversation instead of failing the turn.
What to check before you upgrade
Grep for direct pi-durable imports and for any client code reading error bodies off a failed fetch — those are the two silent breakers. Then look at where your agents currently wait: if a human-approval step is holding an invocation open today, that is the one to port to a parked tool first, and the one where the saving is easiest to measure.
More from DangMua