Repository navigation
fix: stabilize history and open sessions from the latest turn - #3731
Merged
Merged
Conversation
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
Historical conversations could load in several passes, shift after opening or paging, and wait for older Turns before showing the latest reply. Device switches could also collapse or temporarily empty workspace session lists. Open local/SSH and capable peer sessions from the latest complete Turn, preserve the reader's position with native bottom-origin history layout, and retain device/workspace list state across surface replacement.
Type and Areas
Bug fix, performance improvement and regression tests. Web UI, Remote Connect services, device navigation, desktop pet styling, CI runner selection, and owner documentation. Follow-up to merged #3725.
Motivation / Impact
Local and SSH restores request one Turn. Peer controllers negotiate an optional single-Turn snapshot through the existing encrypted
read_streamRPC. Large Turns still use bounded packets, but older Turns cannot expand the first-paint wait. Snapshot identity, membership/count, offsets, epoch and revision fences prevent incomplete or stale replay.Show a short final Turn at the top with CSS trailing space, or the end of a long final Turn. Older history grows upward without estimating content heights for placement, remounting the current rows or passive scroll correction. Preserve chronological navigation, bookmarks, reader anchors and live/submission handoffs.
Wait for visible presentation before adjacent prefetch; retain loaded partial sessions on return instead of draining full history. Keep live catch-up and permission/mailbox delivery working while an older Turn is fetched. Reduce the loading handoff's extra animation wait.
Keep session-list expansion scoped to device/workspace/source, reset it on explicit collapse, and reseed catalog metadata when a surface container is discarded. Route signed-out device controls to account management; use neutral device cards and translucent neutral pet bubbles with status-colored glyphs.
Fix the previous CI failure's five viewport-test timeouts: cache repeated geometry calculations within a single synchronous read and deliver fixture ResizeObserver callbacks only for changed boxes. Preserve every frame, scenario, assertion and the existing 5s timeout.
Pin routine Rust/CLI macOS validation to the standard
macos-15-intelpool after repeated ARM64 hosted-runner allocation failures. Both jobs retain every existing compile/test command, and their shared OS matrix remains explicitly checked. This changes native CI execution to macOS x64; release target selection remains independent. On a cold Intel runner the CLI was still compiling when its 30-minute limit expired, so only that matrix entry gets a 75-minute budget.Verification
cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect --lib remote_connect::host_stream: 37 passed, including single-Turn selection, immutable packet retries, concurrent live catch-up, tombstones, controller isolation, epoch fences and legacy wire round trips.cargo test --locked -p openbitfun-services-integrations --no-default-features --features remote-connect --test remote_connect_contracts response_helpers: 3 passed.RelaySessionHistory,SessionModule,HistorySessionLoadingBoundary,ModernFlowChatContainer.history-stateandVirtualMessageList.timeline-prepend: 149 passed. FilteredFlowChatStorehistory/relay/restore tests: 142 passed.pnpm --dir src/web-ui exec node scripts/run-vitest.mjs run src/flow_chat/components/modern/VirtualMessageList.resize.test.tsx src/flow_chat/components/modern/VirtualMessageList.timeline-prepend.test.tsx --maxWorkers=2: 32 passed after the CI fixture correction. On the same local machine, the slowest resize case fell from 1.75s to 0.23s and the bookmark case from 4.17s to 1.30s; these are test-harness timings, not product benchmarks.git diff --checkpassed.pnpm run check:webstops at four pre-existing typography-token violations inDeviceWorkspaceSections.scssandSceneBar.scss, both unchanged from upstreammain. This is separate from the failed CI viewport tests; no audit baselines or assertions were relaxed.pnpm --dir src/web-ui exec node scripts/run-vitest.mjs run --maxWorkers=3: all 1,186 files / 13,688 tests passed after the viewport fixture fix. Finaltsc --noEmitpassed.pnpm run check:github-config: 54 passed, 1 skipped because pwsh is unavailable locally (CI executes that truth table);pnpm run check:repo-hygieneandgit diff --checkpassed.522abaf65c78e947106bf3875a5f4cb92dca5596; its final result will be recorded here.Reviewer Notes
AI-assisted; testing level: lightly tested end-to-end, with extensive automated coverage. Automated coverage uses local DOM/store fixtures, simulated SSH payloads, and the real host-stream hub/subscriber over a simulated transport. Real SSH, Remote Control, Peer Device and Detached Dispatch integration/manual checks remain pending. The routine macOS CI now validates x64 execution and is not Apple Silicon runtime evidence. No product UI interaction was run, per the owning guide. A prior static WKWebView fixture verified native short-Turn placement and matching transcript/composer edges; it is not live-device acceptance.
The new peer fast path requires an updated host and controller. Hosts advertise
host_stream_turn_history_v1; the optional response acknowledgement negotiates its use. Legacy hosts retain the complete-record-page fallback and may open more slowly. Existing mobile record-page consumers remain compatible. There is no persisted-shape migration and no relay-server upgrade requirement. Snapshots are ephemeral, controller-scoped and bounded; one oversized Turn may exceed the snapshot budget and is still rendered as a complete unit.Checklist