The floating AI chat rendered NOTHING for the assistant turn (user bubble + "thinking" dots showed, but the streamed text and tool-call cards never appeared) even though the agent ran server-side. The parts DID arrive in `useChat.messages` — this was purely a render freeze. Root cause: the MessageItem `React.memo` comparator (#182) decided whether to re-render by recomputing `messageSignature(prev.message)` vs `messageSignature(next.message)` inside `arePropsEqual` (plus a `prev.message === next.message` fast path). But the AI SDK (ai@6 / @ai-sdk/react@3) streams a turn by MUTATING the same `parts` in place and handing back a message wrapper that SHARES those mutated parts. So inside the comparator both `prev.message` and `next.message` already reflect the latest content — the two signatures are ALWAYS equal — and the memo skipped every post-mount render. The assistant row therefore froze at its initial empty (null) render; reasoning-first providers (e.g. z.ai/GLM) start with a non-visible reasoning part, so the whole answer + tool cards never showed. Fix: snapshot the signature in the PARENT (MessageList) at render time and pass it to MessageItem as an immutable `signature` string prop; `arePropsEqual` now compares that prop. A captured string is immutable, so `prev.signature` holds the previous render's content and `next.signature` the new content — they differ as the turn streams in and the row re-renders. Drop the now-incorrect `prev.message === next.message` fast path (same-ref-but-mutated must still re-render). MarkdownPart's per-part memo is unaffected (it already keys on the primitive `text`). Verified end-to-end against a real OpenAI-compatible provider: the assistant turn (reasoning + streamed text + tool-call card) now renders live and on finish. Regression tests added (render + comparator) that fail before / pass after. 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