Skip to content

fix useChat on hmr#935

Closed
deathbyknowledge wants to merge 1 commit intomainfrom
fix-hmr
Closed

fix useChat on hmr#935
deathbyknowledge wants to merge 1 commit intomainfrom
fix-hmr

Conversation

@deathbyknowledge
Copy link
Member

@deathbyknowledge deathbyknowledge commented Feb 18, 2026

Fixes #50, addressed in cloudflare/partykit#335

@changeset-bot
Copy link

changeset-bot bot commented Feb 18, 2026

⚠️ No Changeset found

Latest commit: 7ec3e44

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@deathbyknowledge
Copy link
Member Author

/bonk review please

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

Open in StackBlitz

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

commit: 5fcc49f

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 18, 2026

remote: Permission to cloudflare/agents.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/cloudflare/agents/': The requested URL returned error: 403

github run

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 18, 2026

Bonk workflow failed. Check the logs for details.

View workflow run

@deathbyknowledge deathbyknowledge marked this pull request as ready for review February 18, 2026 14:56
@deathbyknowledge
Copy link
Member Author

/bonk review please

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 18, 2026

remote: Permission to cloudflare/agents.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/cloudflare/agents/': The requested URL returned error: 403

github run

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 18, 2026

Bonk workflow failed. Check the logs for details.

View workflow run

@threepointone
Copy link
Contributor

is there a better fix we can just do on the partysocket side?

@deathbyknowledge
Copy link
Member Author

is there a better fix we can just do on the partysocket side?

Yes, my bad. cloudflare/partykit#335 looks good?

partysocket 1.1.14 fixes useStableSocket replacing the socket on HMR
effect re-runs. This was the root cause of useChat breaking on HMR —
the socket identity was lost, orphaning in-flight streams and resetting
chat state. No application-level changes needed in ai-chat.
@threepointone
Copy link
Contributor

I'm getting the deps update done in #954

@threepointone threepointone deleted the fix-hmr branch February 20, 2026 10:37
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.

useChat breaks on HMR

2 participants