Chat: a reply that streams during a history read is shown whole

The thread controller records numbered (seq) deltas that arrive while the
newest page is read and folds back those the page does not include, onto its
live parts or parts it lacks; a delta the page already included is not added
again when it arrives late. The page's order now leads when a reply streamed
during the initial read, so the reply stays below its prompt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 15:46:54 +00:00
parent 2cdd524ecc
commit aeefe67631
4 changed files with 266 additions and 3 deletions
@@ -163,6 +163,9 @@ class ChatRepository {
'nextCursor': '${page['next_cursor'] ?? ''}',
'hasMore': page['has_more'] == true,
'turnDiffs': ?turnDiffs,
// A streaming reply's text so far (see chat_live_frames.dart).
if (page['live_seq'] is int) 'liveSeq': page['live_seq'],
if (page['live_parts'] is List) 'liveParts': page['live_parts'],
};
}
return {