9184915c42
The inflight-turn journal can outlive the turn it recorded (reclaim, reconnect or restart races skip the settle that clears it). On session resume the fold then re-appends journaled assistant rows to a transcript that already holds the committed replies, so the conversation ends with duplicate answers in scrambled order. The fold also carried the stale entry's streamId onto the resumed state on an idle resume, which kept the journal entry alive (persistInFlightTurnState only clears when streamId is null) and re-folded the same tail on every open. Detect text-level staleness before the append path: when every recoverable journaled assistant row already exists as committed text in the base transcript, treat the entry as caught up and clear it. Only keep a stream target when the resumed session is genuinely running (keepPending), so an idle resume self-heals instead of re-folding.