Skip to content

fix: stabilize history and open sessions from the latest turn - #3731

Merged
bobleer merged 6 commits into
GCWing:mainfrom
bobleer:bob/fix-history-device-jitter
Nov 5, 2026
Merged

bobleer merged 6 commits into
GCWing:mainfrom
bobleer:bob/fix-history-device-jitter

Conversation

@bobleer

@bobleer bobleer commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

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_stream RPC. 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-intel pool 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.
  • Focused frontend suites for RelaySessionHistory, SessionModule, HistorySessionLoadingBoundary, ModernFlowChatContainer.history-state and VirtualMessageList.timeline-prepend: 149 passed. Filtered FlowChatStore history/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.
  • Previous focused sidebar, device controls, background catalog seeding and pet-style suites: 47 passed across four files. The broader original FlowChat regression covered 406 tests across 30 files.
  • TypeScript check passed; lint passed with 18 existing warnings. Changed-Rust formatting, theme color audit (28 surfaces) and git diff --check passed.
  • Additional pnpm run check:web stops at four pre-existing typography-token violations in DeviceWorkspaceSections.scss and SceneBar.scss, both unchanged from upstream main. 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. Final tsc --noEmit passed.
  • pnpm run check:github-config: 54 passed, 1 skipped because pwsh is unavailable locally (CI executes that truth table); pnpm run check:repo-hygiene and git diff --check passed.
  • GitHub CI is running on 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

  • Requested changes contain no secrets, temporary prompts or generated scratch files.
  • Relevant verification, CI correction and pending remote/manual checks are recorded.
  • Owner documentation is updated; no new localized product strings.

@bobleer bobleer changed the title fix: stabilize history loading and device session navigation fix: stabilize history and open sessions from the latest turn Nov 4, 2026
@bobleer
bobleer merged commit caed092 into GCWing:main Nov 5, 2026
13 checks passed
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