Repository navigation
fix(mobile): stop announcing sync behind live output - #883
Merged
Merged
Conversation
A reconcile behind a streaming run is routine engine traffic: the lane heals every gap from the durable journal while the run streams, and the desktop's resync signals (a projection snapshot, the streaming flip at run end) arrive while it is generating. The pill above the transcript therefore came up over and over during a long answer, reporting a wait the reader was already watching — the transcript grows with the run's own streaming row. Live output now owns that wait, exactly as a pull's own spinner does: the plain "syncing" state stands down while the model generates. The retrying and waiting-for-connection states stay, because streaming text cannot say them, and the pill returns as soon as the run settles while the lane is still catching up. The test holds the pill up under a plain reconcile and takes it down when the run starts streaming, keeps both richer states visible through it, and asserts it comes back once generation ends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
During a long streaming answer the phone kept showing 正在同步… above the transcript, over and over, while the reply was visibly growing.
The pill is driven by the sync lane's status (
timelineSyncStatus), and a reconcile behind a streaming run is routine engine traffic rather than a user-visible state:get_events_since) while the run streams, andrun_snapshot→ a fullresendreconcile), and the streaming flip at run end (snapshot-flip).So a reader watching the answer arrive got a second, non-actionable progress report on top of the streaming text, for waits they can do nothing about.
Change
Live output now owns that wait, the same way a pull's own spinner already does (
pullOwnsTheWait): while the model is generating, the plain syncing state stands down. The two richer states stay — streaming text cannot say retrying or waiting for the connection — and the pill comes back as soon as the run settles while the lane is still catching up, so a lane that actually fails or stalls is still surfaced.No change to the sync engine, its integrity checks, or when a lane is considered synced: this only stops reporting the wait twice.
Tests
mobile/src/features/chat/__tests__/ChatScreen.test.ts— new case live output is the only report of the wait behind it:retryingandwaitingNetworkstay visible while it streams;Falsified: dropping
!liveOutputOwnsTheWaitfrom the gate makes the new test fail at the streaming assertion.Docs:
docs/internals/mobile/README.md+README.zh-CN.mdstate the rule next to the behaviour they describe.Checks
cd mobile && npx tsc --noEmit— cleannpx eslint src/features/chat/ChatScreen.tsx src/features/chat/__tests__/ChatScreen.test.ts— cleannpx jest --runInBand— 144 suites / 2906 tests passNote on the trigger
The reconcile reasons above are read from the engine's own paths; they are not yet confirmed against a device log. If the pill still appears after this change (for example a run that ends and then sits in a long reconcile),
[remote] session timeline sync timingon the phone carries thereason,attempt,stagesMsandoutcomefor each attempt and would say which path it is.