Skip to content

Comments

Fix stale agent ref in useAgentChat#930

Merged
threepointone merged 1 commit intomainfrom
fix-stale-agent-ref
Feb 17, 2026
Merged

Fix stale agent ref in useAgentChat#930
threepointone merged 1 commit intomainfrom
fix-stale-agent-ref

Conversation

@threepointone
Copy link
Contributor

Ensure the agentRef used by the WebSocketChatTransport is updated synchronously during render so useMemo doesn't capture a closed/stale agent (fixes sendMessage hitting a dead WebSocket when an agent reconnects or switches under React StrictMode).

Also includes various dependency bumps across examples/experimental packages and tooling (kumo, viem, @cloudflare/vite-plugin, @openai/agents, ai, oxfmt/oxlint, wrangler/workerd, etc.), adds ai-chat e2e setup and test adjustments, and minor accessibility/lint fixes in example UI components.

Ensure the agentRef used by the WebSocketChatTransport is updated synchronously during render so useMemo doesn't capture a closed/stale agent (fixes sendMessage hitting a dead WebSocket when an agent reconnects or switches under React StrictMode).

Also includes various dependency bumps across examples/experimental packages and tooling (kumo, viem, @cloudflare/vite-plugin, @openai/agents, ai, oxfmt/oxlint, wrangler/workerd, etc.), adds ai-chat e2e setup and test adjustments, and minor accessibility/lint fixes in example UI components.
@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2026

🦋 Changeset detected

Latest commit: a3397c5

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

This PR includes changesets to release 1 package
Name Type
@cloudflare/ai-chat 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

pkg-pr-new bot commented Feb 17, 2026

Open in StackBlitz

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

commit: a3397c5

@threepointone threepointone merged commit cd408fe into main Feb 17, 2026
4 checks passed
@threepointone threepointone deleted the fix-stale-agent-ref branch February 17, 2026 20:46
@github-actions github-actions bot mentioned this pull request Feb 17, 2026
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.

1 participant