Commit 67fa09c
fix(client): preserve reasoning messages after MESSAGES_SNAPSHOT (#1370)
Reasoning messages (role: 'reasoning') are emitted during streaming
via REASONING_MESSAGE_START/CONTENT events but are not included in
the final MESSAGES_SNAPSHOT (reasoning is metadata on AI chunks, not
a LangChain message type).
The snapshot filter in default.ts only exempts 'activity' role from
the snapshot-based filter, so reasoning messages are dropped when the
snapshot arrives — they disappear from agent.messages after the run.
Fix: Extract a helper isClientOnlyRole() that exempts both 'activity'
and 'reasoning' roles from snapshot filtering, preserving reasoning
messages across the snapshot merge.
Closes #1262
Co-authored-by: giulio-leone <giulio.leone@users.noreply.github.com>
Co-authored-by: Alem Tuzlak <t.zlak97@gmail.com>1 parent 74fd5ba commit 67fa09c
1 file changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
| 544 | + | |
544 | 545 | | |
545 | 546 | | |
546 | | - | |
547 | | - | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
548 | 552 | | |
549 | | - | |
550 | | - | |
| 553 | + | |
| 554 | + | |
551 | 555 | | |
552 | 556 | | |
553 | 557 | | |
| |||
0 commit comments