Handle bundled ReadableStream responses in ModelResult#33
Handle bundled ReadableStream responses in ModelResult#33w0nche0l wants to merge 1 commit intoOpenRouterTeam:mainfrom
Conversation
5a58072 to
bc9d619
Compare
a18685b to
a324625
Compare
|
Thanks for the fix. I’d recommend closing this one in favor of #34, since the two PRs are overlapping fixes to the same stream-detection bug rather than independent changes. This PR adds If there’s anything from this PR you want to preserve, I’d fold it into #34; otherwise #34 should be the base to move forward with after it adds the patch changeset and regression tests. |
|
sounds good! primarily submitted both because i couldn't tell if the getReader check was intentional. We probably do want to remove the name check either way in #34 though. closing this out! |
Summary
workerdworkflow)constructor.name === "EventStream"check.value instanceof ReadableStreaminheritance check.Verified Repro
I verified the naming check with a fresh minimal OpenNext Cloudflare Worker project using:
next@16.2.4@opennextjs/cloudflare@1.19.5wrangler@4.87.0@openrouter/agent@0.4.0Minimal route:
Deploying that project to Cloudflare Workers with real
OPENROUTER_API_KEYandOPENROUTER_MODELsecrets returned:wrangler tailshowed:Expected result:
{ "text": "ok", "object": "response" }With this diff as a local patch, it succeeded.