Commit a8ef922
committed
fix(runner): flush assistant text per message to preserve session replay interleaving
Previously runInner accumulated all assistant text into a single
strings.Builder and only wrote one assistant entry at the end of the
run. Tool calls were recorded eagerly, so replaying a session saw
all tools collapse into one big activity group and the intermediate
assistant progress messages disappeared.
Flush the builder after each streaming/non-streaming assistant
message so the JSONL keeps the real message/tool interleaving.
Session history reconstruction already handles content before/after
tool calls correctly.
Fixes the 'message grouped into activity group after switching
sessions' issue in the desktop/web UI.1 parent 55ff916 commit a8ef922
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
441 | 449 | | |
442 | 450 | | |
443 | 451 | | |
| |||
490 | 498 | | |
491 | 499 | | |
492 | 500 | | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
493 | 507 | | |
494 | 508 | | |
495 | 509 | | |
| 510 | + | |
| 511 | + | |
496 | 512 | | |
497 | 513 | | |
498 | 514 | | |
| |||
0 commit comments