Commit 29dcf58
committed
fix: show first chat message immediately in new sessions
The first message in a new agent chat session was not displayed
optimistically. Two issues caused this:
1. ChatMessages early-returned with the empty-state placeholder when
messages was empty, ignoring pendingUserMessage entirely.
2. applySessionSnapshot and applySessionEvent cleared pendingUserMessage
when the server reported working=true, even before the actual user
message appeared in the stream. For a brand-new session this created
a window where both pending and real messages were absent.
Now the empty-state check accounts for pendingUserMessage, and the
pending bubble is only cleared once the real user message arrives.1 parent 325fb6b commit 29dcf58
2 files changed
Lines changed: 6 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
255 | | - | |
| 255 | + | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
| 258 | + | |
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
| |||
292 | 291 | | |
293 | 292 | | |
294 | 293 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
300 | 297 | | |
301 | 298 | | |
302 | 299 | | |
| |||
0 commit comments