perf(session): reduce startup and historical session overhead#760
Open
limityan wants to merge 2 commits into
Open
perf(session): reduce startup and historical session overhead#760limityan wants to merge 2 commits into
limityan wants to merge 2 commits into
Conversation
Load historical session views with smaller UI payloads, defer stale snapshot refreshes until session history is ready, and aggregate startup/session diagnostics without logging normal optional-config misses. Also keeps remote workspace identity in the measured paths so startup and session hydration traces stay actionable without adding extra frontend/backend round trips.
a746a00 to
cf7cb08
Compare
Batch startup config reads with legacy fallbacks to reduce cold-start IPC overhead. Update dialog-turn metadata incrementally on the normal save path while serializing per-session metadata writes and retaining full-scan fallback for inconsistent storage. Defer snapshot refresh work while historical session context restore is pending, bound session response trace estimation, and preserve compatibility fallbacks across mixed remote identities.
cf7cb08 to
199b176
Compare
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
restore_session_viewfalls back torestore_session_with_turns, then to the legacyrestore_session+load_session_turnssequence;get_configsfalls back to per-keyget_config.Behavior
Performance Benefits
get_configscall on supported builds.Risks / Watch Points
Independent Audit Adjustments
contextRestoreState=pending, avoiding snapshot manager initialization while historical context is intentionally deferred.Verification
git diff --check upstream/main..HEADrustfmt --edition 2021 --check src/crates/core/src/agentic/persistence/manager.rspnpm run type-check:webpnpm run lint:webpnpm exec vitest run src/flow_chat/services/flow-chat-manager/SessionModule.test.tspnpm exec vitest run src/infrastructure/api/service-api/ApiClient.test.ts src/tools/snapshot_system/hooks/snapshotRefreshPolicy.test.ts src/flow_chat/store/FlowChatStore.test.tspnpm exec vitest run --maxWorkers=1cargo test -p bitfun-core save_dialog_turn_updates_metadata_without_scanning_unrelated_turn_files -- --nocapturecargo test -p bitfun-core concurrent_dialog_turn_saves_keep_metadata_counts_consistent -- --nocapturecargo check -p bitfun-desktop