Cloudflare Agents SDK 0.34.1: Pi 1.6.1 changes how waiting tools return
agents@0.34.1 moves to Pi 1.6.1: tools now park with { kind: "sleep", signals, until }. The old shape compiles but returns empty.
What changed
agents@0.34.1, released November 25, 2026, adds support for Pi 1.6.1 (~1.6.1).
- Pi tools now park by returning
{ kind: "sleep", signals, until }instead of{ sleep: { ... } }. - A signal's state is
{ kind: "value", value }or{ kind: "expired" }. - The release notes warn that "a tool that still returns the old shape compiles but ends with an empty result."
agents/models/pi-ainow matches pi-ai 1.6.1: a chat-completions stream ending withfinish_reason: "error"now fails and is retried under the harness retry settings, andonResponsenow sees every response, including failures.
What to do
Before upgrading, find every Pi tool that waits and change it to return the new { kind: "sleep", signals, until } shape, reading signal states as value or expired. TypeScript will not catch the old shape, so test each waiting tool after the upgrade.
Source
Affected by this? Start from a checked Cloudflare Workers AI integration
Code with pinned versions, checked against the official docs on a schedule.
