How a streaming reply is kept and shown in Nyxs (live copies vs. the chat state). Use whenever changing src/lib/liveMessages.ts, src/lib/useChatStore.ts's commit of live replies, how a reply's streaming flag ends, or when a finished reply still shows "Working…" or an old version of itself.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Nyxs Live Messages?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nyxs-code-nyxs-live-messages)
---
name: nyxs-live-messages
description: How a streaming reply is kept and shown in Nyxs (live copies vs. the chat state). Use whenever changing src/lib/liveMessages.ts, src/lib/useChatStore.ts's commit of live replies, how a reply's streaming flag ends, or when a finished reply still shows "Working…" or an old version of itself.
---
# Live replies
While a reply streams, its ticks don't go through React state: they land in a per-message live
copy (`setLiveMessage` in `src/lib/liveMessages.ts`), and only that row re-renders
(`useLiveMessage`). The chat state gets the live copies folded in (`withLiveMessages`) every
`LIVE_COMMIT_MS` (1000 ms, `src/lib/useChatStore.ts`) and at once when anything else changes or
the reply stops streaming; then `clearLiveMessages` drops them.
## The rule that broke once
**A live copy never wins over a finished reply.**
- `withLiveMessages`: a message in the state that is no longer `streaming` keeps the state's
version (`if (!lm || lm === m || !m.streaming) return m`).
- `useLiveMessage`: a finished message in the state is shown as is, even if a live copy is still
around (`current && message.streaming ? current : message`).
In v0.8.66 the turn's end and another state update landed together: the snapshot taken for the
update still held the old live copy with `streaming: true`, folded it over the finished reply,
and the chat stayed on "Working…" after the agent had finished. v0.8.67 fixed it with the two
checks above.
## When changing this
- Keep live copies keyed by chat and message (`keyOf`), and only for replies that stream.
- A snapshot (`snapshotLiveMessages`) is taken when an update is asked for: any code that folds
it must check the state's `streaming` flag first.
- Tests: `src/lib/__tests__/liveMessages.test.tsx` ("stays finished when another change is asked
for in the same moment as the end", "never shows a leftover live copy over a finished
reply"). Add a case for any new path, and check it fails without the fix.