Port the only substantive fix #211 was missing relative to #203 (which is being closed): the "Send now" handler branched on the closure-captured isStreaming, but a turn can finish between render and click. In that window stop() is a no-op, so arming flushOnAbortRef/interruptNextSendRef would strand those one-shot flags and leak into a later, unrelated Stop (auto-sending a queued message the user never asked to send). - Mirror the live useChat status in statusRef (updated each render) and branch sendNow on it instead of isStreaming, so the not-streaming path runs when the turn has already ended and the interrupt flags are never armed against a no-op stop(). - Belt-and-suspenders: clear flushOnAbortRef/interruptNextSendRef when a new turn starts streaming, defusing the sub-render-tick window where a flag could still be armed but the expected abort never fired. No-op for the legit interrupt path (both refs are consumed synchronously beforehand). Keeps #211's existing structure and its flushNext-returns-boolean fix. The rest of #203's divergence is comment rewording, a server-side rename of the same pure interrupt-gate, and fewer tests — nothing else to port. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist