// AI Platform Drift

Agents SDK v0.34.0 upgrades PiHarness to Pi 1.6, breaking backward compatibility

Cloudflare developer changelog · published 2026-11-21 19:18 UTC
ACTION NEEDED MIGRATE APIDEPRECATIONMODEL
WHAT CHANGEDCloudflare Agents SDK v0.34.0 upgrades PiHarness from Pi 1.5 to Pi 1.6. Once a conversation runs on Pi 1.6, Pi 1.5 cannot run its tool calls or model requests. API method signatures changed: harness.signal() replaces (await harness.pi()).signal(), and harness.root() must be called before reaching the root session through harness.pi(). A new error type MCPAuthorizationRequiredError is introduced for MCP re-authorization. The claudeCode() default model changed to claude-sonnet-5-5. Workers AI models were retired on November 20, 2026.
WHY IT MATTERSRolling back to Pi 1.5 after upgrading will break existing conversations that have run on Pi 1.6. Applications using the old signal delivery pattern or accessing the root session without calling harness.root() first will fail. MCP client implementations that do not catch the new error type will not handle re-authorization correctly.
WHAT TO DOReview the Pi Durable 1.6.0 changelog and Agents SDK v0.34.0 changelog for the full list of breaking changes. Update signal delivery calls from (await harness.pi()).signal() to harness.signal(). Add harness.root() calls before accessing the root session. Implement MCPAuthorizationRequiredError handling to redirect users to error.authUrl and provide a way to call reconnectMcpServer(id). Plan to roll forward rather than roll back if deployment issues occur.
Model-reported confidence 95% (not measured accuracy) Primary source ↗ written by anthropic/claude-sonnet-4.5
Show the reasoning — raw diff, triage verdict, confidence
RAW DIFF
+## Agents - 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/
+Fri, 20 Nov 2026 00:00:00 GMT
+
+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() and continue() take notify, so a parked tool wakes when another session's input settles. Refer to Wait for a subagent.
+Approval gates. A beforeTool hook 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(), and sessions.fork() take Pi's init, which writes messages into the transcript in the commit that creates the session. The root session is now created on its first use, so harness.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-ai sends 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 MCPAuthorizationRequiredError with a link. A failed server stays failed until you call the new reconnectMcpServer(id). Refer to Failures and reconnecting.
+Failed requests no longer send error details. A failed request gets a generic 500 response, and a failed WebSocket upgrade closes with code 1011. Use onFetchError() 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's ai.images() run the FLUX.2 image models. claudeCode() defaults to claude-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!
HOW IT WAS JUDGED
Triage signals below are model-reported assertions, preserved verbatim; they are not independent arithmetic verification.
triage verdictMATERIAL at 0.92, needed 0.5
triage reasoningBreaking API upgrade with incompatible session format, new error handling requirements, and model changes.
signalsbreaking API changes documented · model version upgrade (Pi 1.5 → Pi 1.6) · backward incompatibility warning · new SDK version (v0.34.0) · API method signature changes (harness.signal, harness.root) · new error type (MCPAuthorizationRequiredError) · deprecation of old patterns · model defaults changed (claudeCode → claude-sonnet-5-5) · Workers AI models retired date (November 20, 2026)
suppression—
triage modelanthropic/claude-haiku-4.5 ($0.00000)
writer modelanthropic/claude-sonnet-4.5 ($0.00000)