fix(desktop): restore turn-elapsed timer across session switches via gateway turn_started_at (salvage #61518) - #87237
Merged
Conversation
Contributor
૮ >ﻌ< ა ci reviewran on a4ed014 — style: order deep-parent fixture import before siblings (per
|
Rebased onto latest origin/main. Resolved conflicts in: - use-session-actions.test.tsx: kept both HEAD's image-attachment test and PR's turn-clock restoration test (orthogonal features) - use-session-actions/index.ts, gateway-event.ts, server.py, test_tui_gateway_server.py, test_protocol.py: adapted to HEAD's refactored structure while preserving PR's turn-origin tracking
This was referenced Aug 15, 2026
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.
Summary
Salvage of #61518 (@yingliang-zhang) onto current main: the turn-elapsed timer reset to 0:00 on session switch / cold resume because the gateway never reported when the running turn began — the desktop's cold-resume path fell back to
Date.now().Complements #86923 (submit-time arm covers turns THIS window started); this covers turns the window did NOT start — cold resume onto a running session, adopted turns — by carrying
turn_started_atfrominflight_turn.started_atthroughsession.resumeandsession.info.Changes
turn_started_atin_session_info()and_live_session_payload(); desktop restores the clock on cold resume from the resume payload (validated numeric, seconds→ms), and therunning=trueheartbeat prefers the gateway timestamp overDate.now(); shared JSON round-trip fixture pins the contract on both sides.Validation
Infographic