Repository navigation
perf(sessions): page catalogs and share external history snapshots - #3438
Merged
Merged
Conversation
Pin observed session timestamps for paged queries and recapture ordering when the host catalog changes. Cover old-host fallback and independent native forks from retained history versions.
3 tasks done
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
Reduce repeated work when discovering external sessions, opening long histories, and expanding the workspace session list.
Related: #3424. The separate imported-session mode fix is #3439; both PRs target
mainindependently.Type and Areas
Type: Performance improvement, refactor, regression fix, tests, docs.
Areas: Rust core and session persistence services; Desktop/CLI session catalog adapters; Web UI navigation and session history.
Motivation / Impact
Opening or expanding a session list previously repeated catalog traversal, filtering/sorting, and ownership work. Reading different windows of one external history also repeatedly parsed and cloned the entire frozen body.
The default list now requests its visible page and reuses the same catalog revision during expansion. History windows share a bounded cache while refreshing live view metadata separately. A 240-turn fixture verifies one snapshot read, one catalog build, and only 18 copied turns across its tail/catalog/window reads. A 655-record catalog fixture succeeds with only the five selected metadata files available, proving that the first page does not scan every session directory.
Verification
Rebased onto
upstream/mainat01081d3f8; the four performance/review commits were preserved unchanged bygit range-diff.Core: 136 passed, 4 opt-in tests ignored; storage: 43 passed; frontend: 359 passed across 20 files. Type checking and Git checks passed.
check:webpassed after runningnode scripts/generate-miniapp-chat-styles.mjsto match this Windows checkout's generated CSS line endings. The initial failure was in an unchanged upstream MiniApp artifact; normalized content was identical. That temporary generated-file change is excluded from this PR.cargo test --locked -p openbitfun-cli --bin openbitfun session_catalog_query_keeps_legacy_peers_and_workspace_identity_compatible -- --quietpassed during implementation before this rebase. The Desktop payload test previously compiled but its executable could not start on this machine (0xc0000139); it is not counted as passing runtime coverage.CI repair (
6dab34b8d): the previous Frontend Build stopped at the core-boundary gate because it only recognized the old two-argument metadata page call. The guard now requires the services-core store and forwards cursor, limit, and query; the old and query-aware store entrypoints remain required. Added regression coverage rejects dropped parameters, wrong ownership, and removed entrypoints. All 154 boundary tests pass, and the complete boundary check passes in a clean temporary checkout (the main working directory contains an inaccessible pre-existing dependency link). This repair changes only the checker and its tests.Follow-up CI repair (
ef39e5788): preserve the catalog snapshot refresh/device-switch invalidators and explicitly read them in the memo, matching adjacent ordering-revision memos. This resolvesreact-hooks/exhaustive-depswithout dropping either dependency. Fullpnpm run lint:webpasses (0 errors, 11 existing warnings), the 359 focused frontend tests pass again, andpnpm run check:webpasses.GitHub CI on
ef39e5788: run 39042685396 passed. Frontend Build passed all checks, including 1,029 test files / 11,486 tests and the production/mobile builds. All three Rust and all three CLI platform jobs passed, as did the final Rust / CLI Validation check and Repository Object Sizes. Impact-gated jobs retained their normal skipped status.Reviewer Notes
main. A local merge preview identifies one shared edit indeferred/tracking.rs: when combining them, keep fix(sessions): restore valid modes when continuing imported history #3439's mode-normalization call in this PR'soverlay_view_metadatahelper for both cold reads and cached/refreshed views. The second PR will need a rebase after the first is merged.Checklist