Skip to content

Refactor message types to use enum in AIChatAgent and related files#409

Merged
threepointone merged 5 commits intocloudflare:mainfrom
MrgSub:enum-ws-messages
Aug 18, 2025
Merged

Refactor message types to use enum in AIChatAgent and related files#409
threepointone merged 5 commits intocloudflare:mainfrom
MrgSub:enum-ws-messages

Conversation

@MrgSub
Copy link
Copy Markdown
Contributor

@MrgSub MrgSub commented Aug 14, 2025

  • Updated message type references in ai-chat-agent.ts, ai-react.tsx, and other files to use the new MessageType enum.
  • Removed unused imports and ensured consistent usage of message types across the codebase.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Aug 14, 2025

🦋 Changeset detected

Latest commit: da32723

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
agents Patch
hono-agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Aug 18, 2025

Open in StackBlitz

npm i https://pkg.pr.new/cloudflare/agents@409

commit: da32723

@threepointone threepointone merged commit 352d62c into cloudflare:main Aug 18, 2025
3 checks passed
@threepointone threepointone mentioned this pull request Aug 18, 2025
for await (const chunk of response.body!) {
const body = decoder.decode(chunk);

this._broadcastChatMessage({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this broadcast of the text chunks to the client removed? _drainStream seems to perform the chunk decode, but never broadcasts the value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants