November 20, 2026 · Cloudflare
Agents SDK now supports Pi 1.6 with tools that wait without keeping your agent awake
Agents SDK v0.34.0 upgrades PiHarness to Pi 1.6 ↗︎. A Pi tool can now wait for a person, a deadline, or another session without keeping the Durable Object awake, and a session can start from a history that your application already has.
Tools that wait
- Park until a signal or a deadline. A tool can return a park instead of a result, and Pi runs it again when a signal arrives or the deadline passes. While it waits, the call holds no invocation, so the Durable Object can hibernate. Deliver signals with the new
harness.signal(). Refer to Tools that wait. - Wait for a subagent.
submit()andcontinue()takenotify, so a parked tool wakes when another session's input settles. Refer to Wait for a subagent. - Approval gates. A
beforeToolhook can park a tool call before it runs, for example until a person approves it.
Session updates
- Start a session from an existing history.
harness.root(),sessions.create(), andsessions.fork()take Pi'sinit, which writes messages into the transcript in the commit that creates the session. The root session is now created on its first use, soharness.root()can seed it. Refer to Seed a session with an existing history. - Keep queued input across an abort. With
submit(input, { onAbort: "keep" }), stopping an answer does not drop the message that the user or another agent sent next. - Steadier runs. Pi retries more dropped provider connections. When Anthropic can no longer continue a message thread,
agents/models/pi-aisends the whole conversation again instead of failing the turn.PiHarness.dispose()frees Pi AI's per-session state.
Wait for a person's answer
This tool asks the user a question, then parks until your agent delivers the answer:
import { defineSignal } from "@earendil-works/pi-durable";
import { obj, str } from "@earendil-works/pi-schema";
const Answer = defineSignal({
name: "app.answer",
version: 1,
schema: obj({ text: str() }),
});
const AskParameters = obj({ question: str() });
const askUser = {
name: "ask_user",
description: "Ask the user a question and wait for the answer.",
parameters: AskParameters,
async execute({ question }, api, context) {
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, question);
return { sleep: { signals: [Answer.key("answer")] } };
},
};
// Later, in your agent, when the user answers:
await this.harness.signal(taskId, Answer, "answer", { text: "Yes" });import {
defineSignal,
type ToolRegistration,
} from "@earendil-works/pi-durable";
import { obj, str } from "@earendil-works/pi-schema";
const Answer = defineSignal({
name: "app.answer",
version: 1,
schema: obj({ text: str() }),
});
const AskParameters = obj({ question: str() });
const askUser: ToolRegistration<typeof AskParameters> = {
name: "ask_user",
description: "Ask the user a question and wait for the answer.",
parameters: AskParameters,
async execute({ question }, api, context) {
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, question);
return { sleep: { signals: [Answer.key("answer")] } };
},
};
// Later, in your agent, when the user answers:
await this.harness.signal(taskId, Answer, "answer", { text: "Yes" });
While the question is open, the session's run is still going, and the object can hibernate or be evicted. harness.signal() wakes the object, and Pi runs the tool again with the answer.
Other changes
- MCP re-authorization. A request that needs the user to sign in again throws
MCPAuthorizationRequiredErrorwith a link. A failed server stays failed until you call the newreconnectMcpServer(id). Refer to Failures and reconnecting. - Failed requests no longer send error details. A failed request gets a generic
500response, and a failed WebSocket upgrade closes with code1011. UseonFetchError()to choose the response. Refer to Failed requests. - Chat fixes. Stop, clear, regenerate, and resume now work across tabs and during recovery.
- Scheduling fixes. A schedule, queue item, or Task run that is cancelled or replaced no longer runs again.
- Models.
ai.image()and Pi AI'sai.images()run the FLUX.2 image models.claudeCode()defaults toclaude-sonnet-5-5. Examples move off the Workers AI models retired on November 20, 2026.
Upgrade
Once a conversation runs on Pi 1.6, Pi 1.5 cannot run its tool calls or model requests. After upgrading, roll forward to fix deployment issues rather than rolling back to Pi 1.5.
Deliver signals with harness.signal() instead of (await harness.pi()).signal(), and call harness.root() before you reach the root session through harness.pi(). If you use Pi Durable directly, RunEndTask is now HookTask, and code mode namespaces come from Extension.namespace. Refer to the Pi Durable 1.6.0 changelog ↗︎ for the full list of breaking changes.
If you use the MCP client, catch MCPAuthorizationRequiredError and send the user to error.authUrl, and give users a way to call reconnectMcpServer(id) for a failed server. If you relied on error details in failed responses, implement onFetchError().
The Agents SDK v0.34.0 changelog ↗︎ has step-by-step upgrade instructions. Point your coding agent at them and upgrade today:
Copy promptPrompt copied!Free. Unsubscribe any time.
Related updates
Agents SDK now supports Pi 1.5 with fewer storage writes and lower memory use
Agents, Workers - Run the Pi Durable harness on Cloudflare with the Agents SDK
Workers - Agents SDK adds background sub-agents and a unified turn entry point
Workers - Agents SDK improves browser automation, code execution, and recovery