Patch Changes
-
#1659
f99f890Thanks @threepointone! - Recover one-shot scheduled work (alarms) killed by a"This script has been upgraded…"deploy/code-update, not just"Durable Object reset because its code was updated."._executeScheduleCallbackonly re-runs a one-shot schedule row after a superseded-isolate error if the error matched/reset because its code was updated/i. The platform also surfaces the same failure class as"This script has been upgraded. Please send a new request to connect to the new version."(a stub/connection to a superseded script), which fell through to the swallow-and-delete branch — the one-shot row was deleted and the work abandoned. For a queued submission this orphaned the pending row with no driver (no alarm, no retry) until something unrelated woke the Durable Object, leaving the user on an indefinite spinner.The superseded-isolate matcher now recognizes both messages, so either causes the row to be preserved and re-run on the fresh isolate under the at-least-once alarm guarantee.
"Network connection lost."is intentionally not included (it is a connection error that may succeed on in-process retry, not an isolate replacement). -
#1661
41315b6Thanks @threepointone! - Enforce thetool_use.inputinvariant at the chat write boundary.A streamed tool call that finishes with no
input_json_deltaevents (the model called the tool with no args), or whose input surfaces as a stringified JSON blob, could persist a non-objectinput—null,undefined,"", an array, or a raw string. The Anthropic Messages API requirestool_use.inputto be a JSON object and rejects every subsequent turn withtool_use.input: Input should be an object(verified against the live API:{}→ 200, but"",[], and[{...}]all → 400). Because the bad shape lives in durable storage, the session is wedged across reconnects, redeploys, and DO evictions.applyChunkToParts(the shared accumulator used by@cloudflare/ai-chatand@cloudflare/think) now normalizes the finalized toolinputontool-input-available/tool-input-error: a plain object passes through untouched, a stringified-JSON object is parsed, and everything else (null/undefined/""/arrays/primitives/unparseable strings) collapses to{}. A newnormalizeToolInputhelper is exported fromagents/chatso read-side transcript repair can enforce the same invariant. -
#1665
13d6db0Thanks @threepointone! - Await Chat SDK state-agent cleanup scheduling during startup so tests and short-lived worker isolates do not leave dangling cleanup work. -
#1666
01a0b35Thanks @dcartertwo! - Fix MCP OAuth PKCE verifier lookup for overlapping authorization attempts.DurableObjectOAuthClientProvidernow binds pending PKCE verifiers to the OAuth callback state instead of storing a single verifier per client/server. Callback handling runs token exchange and verifier cleanup in the returned state's context, so older auth windows and retry churn no longer exchange an authorization code with another attempt's verifier.