From fbdc9075b5a93a4a12152ebf51c6ec663ed3df72 Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Wed, 5 Aug 2026 18:18:52 -0500 Subject: [PATCH] docs(plugin): clarify HTTP stream handling --- packages/www/content/docs/build/plugins.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/www/content/docs/build/plugins.mdx b/packages/www/content/docs/build/plugins.mdx index 1f2ab1579c..100791cecd 100644 --- a/packages/www/content/docs/build/plugins.mdx +++ b/packages/www/content/docs/build/plugins.mdx @@ -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) => {