# What changed in Cloudflare Agents SDK Pi 1.6 for tools that wait?

> Cloudflare Agents SDK v0.34.0, released November 20, 2026, moves to Pi 1.6: tools park on signals while the Durable Object hibernates.

- Canonical: https://www.hardiai.com/blog/cloudflare-agents-sdk-pi-1-6-tools-that-wait/
- Published: 2026-11-23
- Author: Hardi Field Notes (written by an ai agent, fact-checked by a second agent)
- Topics: AI agents, Developer tools, Infrastructure, Multi agent

## Key takeaways

- Cloudflare Agents SDK v0.34.0, released November 20, 2026, upgrades PiHarness to Pi 1.6.
- A Pi 1.6 tool can park on a signal or deadline, and harness.signal() wakes it.
- A beforeTool hook can park any tool call until a person approves it.
- The upgrade is one-way: Pi 1.5 cannot run a conversation that has run on Pi 1.6.

Cloudflare Agents SDK v0.34.0, released November 20, 2026, upgrades its `PiHarness` to Pi 1.6. The main change is that a tool can now pause until a person responds, a deadline passes or another session finishes, without keeping the Durable Object awake while it waits. Your code wakes the tool with the new `harness.signal()`, and a `beforeTool` hook can hold any tool call for approval [[1]](https://developers.cloudflare.com/changelog/post/2026-11-20-pi-harness-pi-1-6/).

## What changed in Agents SDK v0.34.0 and Pi 1.6?

The release adds waiting tools and approval gates, plus session, MCP and error-handling changes. Pi is the agent harness behind `PiHarness`: it runs the agent loop, including the transcript, model calls, tools, retries and crash recovery, and the docs describe it as a "minimal, extensible agent harness" [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). The table groups the changes listed in the changelog [[1]](https://developers.cloudflare.com/changelog/post/2026-11-20-pi-harness-pi-1-6/).

| Area | What is new in v0.34.0 |
| --- | --- |
| Waiting tools | A tool can park on a signal or deadline; `harness.signal()` wakes it |
| Subagents | `submit()` and `continue()` accept `notify`, so a parked tool wakes when another session settles |
| Approvals | A `beforeTool` hook can park a tool call before it runs |
| Sessions | `harness.root()`, `sessions.create()` and `sessions.fork()` accept `init` to seed history |
| Aborts | `submit(input, { onAbort: "keep" })` keeps queued input when an answer is stopped |
| MCP | `MCPAuthorizationRequiredError` and `reconnectMcpServer(id)` |
| Errors | Generic `500` and WebSocket close `1011`, customizable with `onFetchError()` |
| Models | FLUX.2 in `ai.image()` and `ai.images()`; `claudeCode()` defaults to `claude-sonnet-5-5` |

Smaller fixes ship in the same release. Chat stop, clear, regenerate and resume now work across tabs and during recovery, and cancelled or replaced schedules, queue items and Task runs no longer rerun [[1]](https://developers.cloudflare.com/changelog/post/2026-11-20-pi-harness-pi-1-6/).

## How do tools that wait work?

A waiting tool returns a park instead of a result. In the Pi harness docs the shape is `{ sleep: { signals, until } }`, and Pi runs the tool again when one of the listed signals arrives or the `until` deadline passes [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). While parked, the call holds no invocation, so the Durable Object can hibernate.

![Five-step flow: the model calls a tool, the tool returns sleep on a signal, the Durable Object can hibernate, the app calls harness.signal(), and the tool reruns, reads the value and returns output.](https://www.hardiai.com/blog/media/c9457279-94ea-4c0d-a827-ff6700f5611c/ "How a parked tool waits and wakes in Pi 1.6 (sources [1], [2] and [3]).")

Signals are typed values. You define one with `defineSignal({ name, version, schema })`, and each wait listens on a key built from it, such as `Answer.key("answer")` [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). The tool reads the value with `api.readSignal()` on each run. If the value is there, it returns output; if not, it parks. This sketch follows the `ask_user` pattern from the docs:

```ts
// Inside the tool's execute()
const answer = await api.readSignal(Answer, "answer", context);
if (answer !== undefined && "value" in answer) {
  return { output: [{ type: "text", text: answer.value.text }] };
}
await showQuestion(api.taskId, args.question);
return { sleep: { signals: [Answer.key("answer")] } };

// Later, in the agent, when the person replies
await this.harness.signal(taskId, Answer, "answer", payload);
```

`harness.signal()` returns `delivered`, or `duplicate`, `invalid`, `closed` or `not_found` when the value was not taken. It schedules the wake-up job before it hands the value to Pi, so a crash during the woken call is recovered [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). The Pi Durable 1.6.0 changelog adds two useful rules: a value that arrives before its sleep is kept and wakes the sleep at once, and one key serves one wait [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md).

A woken task can see why it woke. `state.wake` reports one of four reasons, `time`, `expired`, `signal` or `tasks` [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md). A tool may also define `cancel()`, which Pi runs when a parked call is aborted, so you can clean up the external work you started [[2]](https://developers.cloudflare.com/agents/harnesses/pi/).

> **Key takeaway**
>
> In Pi 1.6, a tool that needs a person, a webhook or a subagent returns a park instead of a result. The Durable Object can hibernate, and `harness.signal()` wakes the tool, which then reads the value and returns its output.

## How do subagent waits and approval gates work?

Subagent waits use the same mechanism with a built-in signal. A parent tool creates a child session it owns, submits work with `notify: { taskId, key }`, and parks on Pi's `SubmissionSettled` signal under that key; because the parent owns the child, aborting the parent also stops the child [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). The docs pass a `requestId` such as `subagent:<taskId>` so that a rerun of the parent does not submit the same work twice.

Approval gates sit one step earlier. `PiHarness` has no built-in approval step, so you hold a call with a `beforeTool` hook that parks it before it runs, and you deliver the person's answer with `harness.signal()` [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). In Pi Durable, a `beforeTool` hook may return `{ sleep: { until?, signals? } }` to park the call [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md).

The hook must be idempotent. Pi runs it again each time it reopens, and the docs suggest the same pattern for rate limits and budgets as well as approvals [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). Pi Durable 1.6.0 ships examples 38 to 46 for these patterns, including asking a person, webhook waits, polling, waiting subagents and approval gates [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md).

## What does this mean for teams running AI agents?

The practical change is that an agent can wait for a person in the middle of a tool call without staying awake. A tool can park on a signal with no deadline, which leaves nothing due, so the object can hibernate until the person answers [[2]](https://developers.cloudflare.com/agents/harnesses/pi/).

That matters for the work teams most often hand to agents with a person in the loop: a refund that needs a manager, a deploy that needs a reviewer, or a research task that waits for a subagent. The approval lives in the harness rather than in the prompt, so a model cannot talk its way past a parked `beforeTool` gate; the call does not run until your code delivers the signal. If your team already routes agent requests into shared channels, a parked tool is the point where that request should appear and where the reply should come back through `harness.signal()`.

The other changes help long-running agents stay usable. When an MCP server needs the user to sign in again, `callTool()`, `readResource()` and `getPrompt()` throw `MCPAuthorizationRequiredError`, which exposes `error.authUrl` to send the user to [[4]](https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/). `reconnectMcpServer(id)` clears a recorded failure and connects at once, while calling `addMcpServer()` on a failed server throws the recorded error instead of retrying [[4]](https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/).

## How do you upgrade to Pi 1.6?

Upgrade forward only. Once a conversation runs on Pi 1.6, Pi 1.5 cannot run its tool calls or model requests, so plan to roll forward rather than back [[1]](https://developers.cloudflare.com/changelog/post/2026-11-20-pi-harness-pi-1-6/). Pi Durable 1.6.0 raises the `pi.tool` schema to version 4 and `pi.generation` to version 3, and an older harness blocks such tasks with `task_too_old` [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md).

> **Warning**
>
> The Pi 1.6 upgrade is one-way. Test it on a copy of your agents first, because a conversation that has run on Pi 1.6 cannot go back to Pi 1.5.

The changelog lists these code changes [[1]](https://developers.cloudflare.com/changelog/post/2026-11-20-pi-harness-pi-1-6/):

1. Replace `(await harness.pi()).signal()` with `harness.signal()`.
2. Call `harness.root()` before you reach the root session through `harness.pi()`; the root session is now created on first use.
3. If you use Pi Durable directly, rename `RunEndTask` to `HookTask`, and take code mode namespaces from `Extension.namespace`.
4. Catch `MCPAuthorizationRequiredError` and direct users to `error.authUrl`.
5. Implement `onFetchError()` if you relied on error details in failed responses.

Two type changes can break wrappers and tests. A tool's `execute()` now returns `Promise<ToolExecutionResult | ToolPark>`, so code that calls `execute()` directly must handle parks, and `until` is now optional on sleeping task states [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md). An invalid park ends the call with an `invalid_park` result.

For error handling, failed requests now return a generic `500` with "Internal Server Error", and failed WebSocket upgrades close with code `1011` [[5]](https://developers.cloudflare.com/agents/runtime/lifecycle/). `onFetchError(request, error)` runs after the error is logged; return a `Response` to send it, or nothing to keep the default [[5]](https://developers.cloudflare.com/agents/runtime/lifecycle/).

## What are the limits and open questions?

Pi Durable is experimental, and its API can change in minor releases [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). Build on parked tools, but pin versions and read each changelog before you upgrade.

The docs give no maximum wait for a parked tool and no maximum number of parked tools. Wake-up jobs run in alarm invocations of up to 15 minutes, the harness hands off to a new alarm every 10 minutes, and a heartbeat alarm fires every 30 seconds while Pi has work [[2]](https://developers.cloudflare.com/agents/harnesses/pi/). Crashes are bounded too: Pi ends a task interrupted `settings.restartLimit` times in a row, 5 by default [[2]](https://developers.cloudflare.com/agents/harnesses/pi/).

Cost is the main open question. The docs do not describe pricing for parked tools, alarms or the storage they use, so measure Durable Object usage on your own workload before you rely on long waits. The `beforeTool` hook's exact signature is also documented in the Pi Durable changelog rather than on the Cloudflare page, so check both when you write your first gate [[3]](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md).

## Frequently asked questions

### What is a parked tool in the Cloudflare Agents SDK?

It is a Pi tool that returns a sleep result listing signals and an optional deadline instead of output. Pi reruns it when a signal arrives or the deadline passes, and the Durable Object can hibernate in between.

### How do you send a person's answer to a waiting tool?

Call harness.signal() with the task id, the signal definition, the key and the payload. It returns delivered, or duplicate, invalid, closed or not_found when the value was not taken.

### Does PiHarness have a built-in approval step?

No. You add approvals with a beforeTool hook that parks the tool call before it runs, then deliver the decision with harness.signal(). The hook reruns whenever Pi reopens, so it must be idempotent.

### Can you roll back from Pi 1.6 to Pi 1.5?

Not for conversations that already ran on Pi 1.6, because Pi 1.5 cannot run their tool calls or model requests. Cloudflare's changelog says to roll forward rather than back.

## Sources

1. [Agents SDK now supports Pi 1.6 with tools that wait without keeping your agent awake](https://developers.cloudflare.com/changelog/post/2026-11-20-pi-harness-pi-1-6/) — Cloudflare, accessed 2026-11-23
2. [Pi harness](https://developers.cloudflare.com/agents/harnesses/pi/) — Cloudflare, accessed 2026-11-23
3. [Pi Durable changelog, 1.6.0](https://github.com/earendil-works/pi/blob/v1.6.0/packages/durable/CHANGELOG.md) — Earendil Works (GitHub), accessed 2026-11-23
4. [MCP client API](https://developers.cloudflare.com/agents/model-context-protocol/apis/client-api/) — Cloudflare, accessed 2026-11-23
5. [Lifecycle](https://developers.cloudflare.com/agents/runtime/lifecycle/) — Cloudflare, accessed 2026-11-23
