This release adds support for Pi 1.6, which lets a Pi tool wait for a person, a deadline or another session without keeping the agent awake, and lets a Pi session start from an existing history. MCP clients now say when a user needs to authorize again, and failed requests no longer send error details to the client.
Highlights
- Pi 1.6 support:
agents/harness/pi,agents/models/pi-aiand the Pi tools now run on Pi 1.6, which brings:- Tools that wait: a tool can park until a signal arrives or a deadline passes, and the agent can sleep meanwhile. Deliver signals with
harness.signal(). See Tools that wait. - Wait for a subagent:
submit()andcontinue()takenotify, so a parked tool wakes when another session's input settles. See Wait for a subagent. - Keep queued input across an abort: with
submit(input, { onAbort: "keep" }), stopping an answer doesn't drop the message the user sent next. - Steadier runs: more dropped provider connections are retried, and
PiHarness.dispose()frees pi-ai's per-session state.
- Tools that wait: a tool can park until a signal arrives or a deadline passes, and the agent can sleep meanwhile. Deliver signals with
- Start a Pi session from an existing history:
harness.root(),sessions.create()andsessions.fork()take Pi'sinit. See Seed a session with an existing history. - Anthropic message threads recover when they expire: pi-ai sends the whole conversation again as a new thread instead of failing the turn.
- MCP re-authorization: a request that needs the user to sign in again throws
MCPAuthorizationRequiredErrorwith a link, and a failed server stays failed untilreconnectMcpServer(id). See Failures and reconnecting. - Failed requests no longer leak errors: clients get a generic 500, or a 1011 close for WebSockets. Use
onFetchError()to choose the response. See Failed requests. - Chat races fixed: stop, clear, regenerate and resume now work across tabs and during recovery.
- Other changes: FLUX.2 image models in
ai.image()and pi-ai'sai.images().claudeCode()defaults toclaude-sonnet-5-5. Examples move off the retired Workers AI models. Cancelled schedules, queue items and Tasks no longer rerun.
Upgrading
You only need to make changes if you use the Pi harness, agents/models/pi-ai or the Pi tools, an MCP client, or error details in failed responses.
- Update Pi to
~1.6.0(@earendil-works/pi-durable,pi-ai,pi-schema,chord). Once a conversation runs on Pi 1.6, Pi 1.5 cannot run its tool calls or model requests, so a deployment cannot roll back past this release. Roll forward to fix a bad deploy instead. - Check pi-durable's 1.6.0 changelog if you use pi-durable directly:
RunEndTaskis nowHookTask, a tool'sexecute()may return a park,untilis optional on sleeping tasks, and code mode namespaces come fromExtension.namespace. Code that only usesPiHarnessandPiSessionneeds no changes for these. - Deliver signals with
harness.signal()rather than(await harness.pi()).signal(), which does not schedule the harness's wake first. - Call
harness.root()before reaching the root throughharness.pi(). Until the root is first used,sessions.list()leaves it out andpi.conversation(ROOT_CONVERSATION_ID)returnsundefined, and Pi's ownpi.root()would create it without the harness'sdefaults. Existing roots are unaffected. - Handle MCP re-authorization: catch
MCPAuthorizationRequiredErrorfromcallTool(),readResource()andgetPrompt()and send the user toerror.authUrl. It extendsUnauthorizedError, so existinginstanceof UnauthorizedErrorchecks still match. A failed server is no longer retried on each wake, andaddMcpServer()on one throws its recorded error, so give users a way to try again, such as a Reconnect button that callsthis.reconnectMcpServer(id). - Implement
onFetchErrorif you relied on error details in failed responses, for example to show them only in local development.
Minor Changes
-
#2832
c31b57eThanks @ben-reitz! - AddonFetchError(request, error)to Lifecycle hosts andAgent, which chooses the response when a request or WebSocket upgrade fails. See Failed requests. -
#2782
d6b4441Thanks @mattzcarey! - MCP client: requests that need the user to authorize again throwMCPAuthorizationRequiredErrorwith a link, and failed servers stayfaileduntil the newreconnectMcpServer(id). See MCP client. -
#2925
cf2ad50Thanks @ben-reitz! - Support Pi 1.6 (~1.6.0; Pi 1.5 is no longer supported).harness.signal()delivers a signal to a parked Pi tool.PiSession.submit()andcontinue()takenotify, so a parked tool can wake when another session's input settles, andsubmit()takesonAbort: "keep", so a queued input stays queued when the session is aborted.agents/models/pi-aicounts reasoning and cached tokens that a chat-completions vendor reports at the top level ofusage, as pi-ai does, and resends a conversation in full when Anthropic can no longer continue its message thread, instead of failing the turn. See pi-durable 1.6.0's changelog and Pi harness. -
#2926
6fef21dThanks @ben-reitz! -PiHarnesscreates the root session on its first use instead of when Pi opens, andharness.root({ agent, init }),sessions.create({ agent, init })andsessions.fork(from, { agent, init })take Pi'sinit, so a session can start from an existing history. See Seed a session with an existing history.
Patch Changes
-
#2832
c31b57eThanks @ben-reitz! - WhenonErrorreturns instead of throwing,AgentandAIChatAgentnow pass the original error on, instead ofundefined(or an unawaited promise whenonErroris async). -
#2861
f0f4ed9Thanks @mattzcarey! - Fix chat recovery and resume races: stop now ends a running recovery, recovery yields to a newer question, and a stale resume ACK keeps the tab waiting for the active stream's replay. -
#2860
7e2e11eThanks @mattzcarey! - Fix chat turn races across tabs: clear stops pending replies, regenerate replaces a reply still streaming, a throwingonChatMessagesends an error frame, and repeated tool results no longer re-run the model. -
#2835
5c33d89Thanks @ben-reitz! - Send a burst of messages on a sub-agent connection in one call to the parent, so resuming a sub-agent chat stream shows the partial reply at once instead of replaying it frame by frame (#2820). -
#2914
06a2715Thanks @ben-reitz! -claudeCode()now defaults toclaude-sonnet-5-5, sinceclaude-sonnet-4-5retires on November 30, 2026. -
#2895
47ccc29Thanks @ben-reitz! -DurableObjectOAuthClientProvideris now anOAuthClientProvider, and aBrowseris now aBrowserSource, in apps that compile withexactOptionalPropertyTypes. -
#2913
3d33563Thanks @ben-reitz! - ExportnormalizeCdpSpecandRawCdpProtocolfromagents/browser, so a customBrowserSourcecan build itsspec()from protocol JSON it already has. See Lower-level helpers. -
#2899
1a450e7Thanks @ben-reitz! -ai.image()and pi-ai'sai.images()now run the FLUX.2 image models (@cf/black-forest-labs/flux-2-klein-9b,flux-2-klein-4b,flux-2-dev), sending their multipart input and up to four reference images. -
#2858
5071d3cThanks @mattzcarey! - A schedule or queue item that is cancelled or replaced while its callback waits to retry no longer runs again with the old job. This also holds for sub-agent schedules and queue items, and when a second alarm invocation picks up the replacement. -
#2829
88eb62cThanks @github-actions! -Lifecycle.fetchno longer sends an error's stack to the client when startup or a request handler throws. HTTP requests get a genericInternal Server Errorbody and WebSocket upgrades close with 1011 without an error frame. The full error is still logged. See #2828. -
#2827
e0f95e5Thanks @mattzcarey! - TypeLifecycleCapability.onStart()as returningMaybePromise<void>to match the runner, which awaits it. See Agents. -
#2863
46daba4Thanks @mattzcarey! - Fix MCP client races found by TLA+ model checking: a pending step-up link survives a token refresh, a refresh no longer overwrites a step-up grant, a removed server's tokens stay deleted, a sign-in survivescloseConnection(), an old link no longer fails a server added again, overlapping closes and removals leave a server added again alone,addMcpServer(..., { id })returns a link that works and renames the server in one transaction, configuring elicitation handlers while a server connects no longer fails it and is advertised, step-up rounds count for the scope set of the link that was completed, and a declined sign-in after a refused refresh is recorded as failed (see re-authorization during a session). -
#2856
cff5dd1Thanks @mattzcarey! - An MCP server removed and added again under the same id while it was still connecting now starts clean. The removed server's connect no longer marks the new one failed ("was removed while connecting"), and its retries no longer connect the new one a second time. With a customcreateAuthProvider,removeMcpServer()no longer deletes the stored row of a server added again while it cleared credentials. -
#2899
1a450e7Thanks @ben-reitz! - Suggest@cf/deepseek-ai/deepseek-v4.1-flash-1017instead of@cf/zai-org/glm-4.7-flashin the unknown-model error and doc comments. -
#2781
366d5b5Thanks @github-actions! - Fix Think recovering an interrupted continuation as a duplicate assistant message; recovery now rebuilds the message it continues. Think now requiresagents>=0.34.0. See Chat Recovery. -
#2807
1f3bd92Thanks @ben-reitz! - The piweb_searchandweb_fetchtools give code mode scripts their results as objects. -
#2899
1a450e7Thanks @ben-reitz! - Move off the Workers AI models retired on November 20, 2026: drop MeloTTS andwhisper-tiny-enhandling, send@cf/google/embeddinggemma-2its{ input }shape, and suggest@cf/deepseek-ai/deepseek-v4.1-flash-1017in examples and messages. See Planned model deprecations. -
#2859
f41f395Thanks @mattzcarey! - A Task run cancelled while its attempt is still being claimed no longer starts its handler. -
#2867
0f2727aThanks @mattzcarey! - Stop running client messages on a WebSocket the host has closed. A connection rejected fromonConnectwithconnection.close()could still run one@callablemethod, state update, oronMessagecall. The close happens before the client has the upgrade response, so anything the client sent as soon as it connected arrived after the close, and the platform still delivered it.Connection.close()now records the close in the socket attachment, so the record survives hibernation, and theWebSocketscapability drops every later message on both the hibernating and Cap'n Web wires. Messages the client sent before closing the connection itself still run.