mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 10:28:47 +02:00
Prod bug: earlier assistant replies vanished as new turns completed and only came back on refresh. Debug capture showed why: with persistence on, the run-end snapshot rebuilds history under STORE ids while the client holds it under STREAMED ids (MAF re-mints post-tool-call text ids, their #3619). ag-ui apply treats the snapshot as authoritative — matching ids get replaced (streamed text wiped by the store's empty-content toolCall entry) and the store's text copies were being filtered out by ReconcileSnapshotMiddleware as presumed duplicates, so prior answers had no surviving representation. Reconciling id-mismatched snapshots is unwinnable; skip them instead. During a normal run the client already built the turn from streamed events and the snapshot adds nothing. Hydration replays (empty input.messages) still pass through — there the snapshot IS the conversation, and every reload converges the client to store ids. ReconcileSnapshotMiddleware is replaced by the much simpler DropRunMessagesSnapshotMiddleware. Verified in dev: multi-turn history persists across runs, one card that survives follow-ups, reload replays everything, no duplicates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
22 KiB
22 KiB