cjols lessons
Notes from learning the internals of the Cloudflare Agents SDK. In-progress and unedited.
Lessons
-
05
isStreamingstuck on abort during a tool callWhy calling stop() during a tool call leaves isStreaming permanently true, and how the three-signal derivation in react.tsx makes the fix non-obvious (#1410).
-
04
Workspace.rm range scan
Replacing the LIKE pattern in @cloudflare/shell's recursive rm with a prefix range scan, and the sibling-prefix nuance that makes the lower bound matter (#1539).
-
03
In-band stream error replay parity
Why a reconnecting client sees a stale terminal turn after an in-band model error, and the wire and storage shape needed to fix it (#1575, Part 1).
-
02
Startup recovery wedge
How #1595 wedged a class of Durable Objects permanently, and how #1604 fixed it by moving cross-DO recovery off the startup gate.
-
01
Chat stream lifecycle
How a chat turn moves through Think and AIChatAgent across the wire, the durable store, and programmatic surfaces. With diagrams.