The bundled API client can wrap network calls and understands more streaming event types.
What's wrong with this entry?
The bundled API client can now wrap its own network calls in middleware, and its streaming event filter passes through many more event types. Middleware that reads the response body is rejected with an error telling you to clone it or return a replacement.
- Middleware runs around fetch and receives a parse context.
- The rejection message is exact: middleware must use
response.clone()to inspect the body, orreturn new Response(body, response)to consume and replace it. - Newly forwarded streaming events include
session.updated, outcome-evaluation spans, agent thread messages, session thread status transitions,event_start/event_deltaandsystem.message. - New client namespaces: deployments, deployment runs, webhooks, dreams and tunnels.
middleware consumed the response body; use response.clone() to inspect it, or return new Response(body, response) to consume and replace it
Strings lifted out of the shipped bundle, so the claim above can be checked against them.