Repository navigation
Preserve the reply prefix when opening a streaming session - #35
Conversation
The batcher can see the start before the selected detail exists. Carry the complete same-connection text with its delta so history and the next flush converge on one row. Preserve the reconnect guard when the start is unknown. Verified the Kotlin batcher, decoding and session resume suites (29 tests) and 223 Statecheck checkpoints against the Kotlin reducers. User decisions: - Bring the streaming-prefix fix to Android. - Check late opens, history races, reconnect gaps and duplicate rows.
User decisions: - Implement the Android streaming review fixes on PR 35.
User decisions: - Implement the Android streaming review fixes on PR 35.
|
The review fixes are on this branch through |
User decisions: - Implement the Android streaming fixes on PR 35.
The streamed-prefix fix is now the iOS change and nothing more: the batcher attaches a part's accumulated text, the reducer adopts it, live rows are marked in progress, and reads keep unfinished rows while a session runs. Removed (no counterpart in iOS #323, and not needed for the bug): - settlingText: a REST text row no longer settles the part. The lab serves unfinished text over REST, so opening mid-reply froze the row until TextEnded. - the settled-row checks in TextStarted/TextDelta/TextEnded, and the liveText re-apply loops in applyAuthoritative and applyAuthoritativeMessage are back as iOS has them. - SessionFeatureHistory's earlier-history reconciliation. - mergeTranscript's dropping of in-progress rows, its new default, and the AssistantMarkdown exclusion from projected-message protection. - selectedTranscriptFetch in streamFocusSessionIDs. - the batcher's Dispatchers.Default scope (onOverflow stays: it is iOS's finish(throwing:)). Tests follow iOS #323: the raced-TextEnded test in SessionRefreshReviewTests is restored to the iOS assertion; streaming rows expect inProgress where iOS does; ported openingMidReplyProjectsThePrefixIncludingShedDeltas, cachedReplySurvivesAnOmittingOpenReadBeforeItsFirstDelta, offscreenHistoryRefreshKeepsTheUnfinishedReplyForReopening and the batcher half of openingAfterAnOffscreenFlushShowsThePrefixFromTheQueuedBatch (replacing the Android-only shed-prefix test). The Android-only read-path tests are dropped with the code they covered. Parity rows updated. Verified: scripts/check.sh :server :feature:session :feature:drawer passes on the Android VM, and the 7 new or ported tests ran.
|
I trimmed this to a straight port of iOS #323 and merged Removed, since iOS #323 doesn't have them and the bug doesn't need them: Treating REST text as settled froze a reply opened mid-stream whenever a read returned unfinished text: on session-lab no new words appeared until the reply ended. The ported raced- |
Opening a session after a reply had started streaming showed only the words that arrived after opening, until the reply finished. The event batcher now attaches a part's accumulated text to each delta when it saw the part from its start, and the session adopts it, so the reply shows from its first word.
Port of anomalyco/opencode-ios#323, limited to what that PR changes.
Verified:
scripts/check.shpasses, including the ported iOS #323 tests.