From 183cc652410e0af1fad5fe2bc651c68e6d1fb3b1 Mon Sep 17 00:00:00 2001 From: Scott Sunarto Date: Wed, 19 Aug 2026 01:48:29 -0700 Subject: [PATCH] chore(agentation): drop cross-realm Response workaround --- plugins/agentation/server.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/agentation/server.ts b/plugins/agentation/server.ts index afec8b8..c7388fd 100644 --- a/plugins/agentation/server.ts +++ b/plugins/agentation/server.ts @@ -277,10 +277,7 @@ export default async function plugin(bb: BbPluginApi) { streams.delete(controller); } - // Responses are built through the Hono context rather than `new Response`: - // the host checks `instanceof Response` against its own realm, and only the - // context's constructor is guaranteed to be the same one. - bb.http.route("GET", "/events", (c) => { + bb.http.route("GET", "/events", () => { let self: ReadableStreamDefaultController | null = null; const stream = new ReadableStream({ start(controller) { @@ -308,7 +305,7 @@ export default async function plugin(bb: BbPluginApi) { }, }); - return c.newResponse(stream, { + return new Response(stream, { headers: { "content-type": "text/event-stream", "cache-control": "no-cache, no-transform",