fix: #2013 - correctly invoke controller.error during mid-stream closure and update tests accordingly - #2019
Conversation
…tream closure and update tests accordingly
|
| finish( | ||
| () => controller.error(new Error("WebSocket closed mid-stream")), | ||
| false, | ||
| false | ||
| ); |
There was a problem hiding this comment.
🟡 Bug fix to a published package ships without a release note entry
The published chat transport package is changed to report dropped connections as failures (controller.error(...) at packages/agents/src/chat/ws-chat-transport.ts:437) without adding the required release-note file, so the fix will not be versioned or published.
Impact: Users won't receive the fix in a released version and the change won't appear in the changelog.
Repository rule: changesets are required for package bug fixes
AGENTS.md (Contributing → Changesets) states: "Changes to packages/ that affect the public API or fix bugs need a changeset". This PR modifies packages/agents/src/chat/ws-chat-transport.ts (a behavioural bug fix that also changes observable transport semantics for @cloudflare/ai-chat consumers) but .changeset/ contains no new entry for agents (existing files: flux-keyterms-array.md, fresh-types-agree.md, fuzzy-pandas-pay.md, neat-spans-nest.md, none added by this commit).
Prompt for agents
AGENTS.md requires a changeset for any bug fix in packages/. Add a new file under .changeset/ (e.g. via `pnpm exec changeset`) declaring a patch bump for the `agents` package, describing that a WebSocket close before the terminal done frame now errors the chat stream instead of closing it cleanly (fixes #2013).
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
please add a changeset
agents
@cloudflare/ai-chat
@cloudflare/codemode
create-think
hono-agents
@cloudflare/shell
@cloudflare/think
@cloudflare/voice
@cloudflare/worker-bundler
commit: |
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This PR aims to fix #2013 by correctly invoking
controller.errorduring a websocket closure before receiving adone: trueframe. This previously led to the AI SDK'suseChatinterpreting this as a normal completion.Tests have also been updated accordingly.