Skip to content

Fix flaky React and chat concurrency tests#1426

Merged
threepointone merged 1 commit into
mainfrom
fix/react-ai-chat-flakes
Apr 30, 2026
Merged

Fix flaky React and chat concurrency tests#1426
threepointone merged 1 commit into
mainfrom
fix/react-ai-chat-flakes

Conversation

@threepointone

@threepointone threepointone commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reuse an already-started React test worker during browser global setup instead of killing a healthy worker on the shared test port.
  • Make the useAgent server-broadcast state test use two clients in a unique room so it exercises the actual server broadcast path.
  • Give debounce/merge concurrency tests enough first-turn runtime for overlapping submits to be admitted before supersession checks run.

Test plan

  • npx vitest --run -c packages/agents/src/react-tests/vitest.config.ts packages/agents/src/react-tests/useAgent.test.tsx
  • npx vitest --run -c packages/ai-chat/src/tests/vitest.config.ts packages/ai-chat/src/tests/message-concurrency.test.ts
  • npm run check

Made with Cursor


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Apr 30, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 82815ba

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

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 3 additional findings.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented Apr 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

agents

npm i https://pkg.pr.new/agents@1426

@cloudflare/ai-chat

npm i https://pkg.pr.new/@cloudflare/ai-chat@1426

@cloudflare/codemode

npm i https://pkg.pr.new/@cloudflare/codemode@1426

hono-agents

npm i https://pkg.pr.new/hono-agents@1426

@cloudflare/shell

npm i https://pkg.pr.new/@cloudflare/shell@1426

@cloudflare/think

npm i https://pkg.pr.new/@cloudflare/think@1426

@cloudflare/voice

npm i https://pkg.pr.new/@cloudflare/voice@1426

@cloudflare/worker-bundler

npm i https://pkg.pr.new/@cloudflare/worker-bundler@1426

commit: 82815ba

@threepointone threepointone merged commit 2a151fd into main Apr 30, 2026
2 checks passed
@threepointone threepointone deleted the fix/react-ai-chat-flakes branch April 30, 2026 13:03
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