docs(plugin): clarify HTTP stream handling

This commit is contained in:
Aiden Cline
2026-08-05 18:18:52 -05:00
parent ccba1c0df9
commit fbdc9075b5
+4 -2
View File
@@ -253,8 +253,10 @@ Runtime hooks intercept live operations:
HTTP hooks can modify requests and responses. They apply to native models; AI
SDK models do not currently pass through these hooks. Request and response
bodies are streams; use `event.request.clone()` or `event.response.clone()`
when reading a body without replacing it.
bodies are one-shot streams. Use `clone()` when you intentionally need a
separate reader, but be aware that its slower branch may buffer data. To inspect
or modify chunks while preserving streaming, replace the body with one piped
through a `TransformStream`.
```ts
await ctx.session.hook("http.request", (event) => {