Skip to content

fix(mobile): stop announcing sync behind live output - #883

Merged
huichen merged 1 commit into
mainfrom
fix/sync-notice-streaming
Sep 27, 2026
Merged

huichen merged 1 commit into
mainfrom
fix/sync-notice-streaming

Conversation

@huichen

@huichen huichen commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

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:

  • the lane heals every gap from the durable journal (get_events_since) while the run streams, and
  • the desktop's own resync signals land mid-run — a projection snapshot after one of its re-attaches (run_snapshot → a full resend reconcile), 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:

  • the pill is up under a plain reconcile, and gone once the run streams (past the minimum-visible window);
  • retrying and waitingNetwork stay visible while it streams;
  • a return to a plain reconcile is quiet again, and the pill comes back when generation ends.

Falsified: dropping !liveOutputOwnsTheWait from the gate makes the new test fail at the streaming assertion.

Docs: docs/internals/mobile/README.md + README.zh-CN.md state the rule next to the behaviour they describe.

Checks

  • cd mobile && npx tsc --noEmit — clean
  • npx eslint src/features/chat/ChatScreen.tsx src/features/chat/__tests__/ChatScreen.test.ts — clean
  • npx jest --runInBand — 144 suites / 2906 tests pass

Note 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 timing on the phone carries the reason, attempt, stagesMs and outcome for each attempt and would say which path it is.

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.
@huichen
huichen enabled auto-merge (squash) September 27, 2026 09:14
@huichen
huichen merged commit f25a22a into main Sep 27, 2026
12 checks passed
@huichen
huichen deleted the fix/sync-notice-streaming branch September 27, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant