Repository navigation
Session History: find every agent's older sessions in Workspace and Project views - #29977
Conversation
…and Project views Session History kept only the newest sessions across every agent, then filtered by workspace; only Claude, Pi and CodeBuddy got their older in-scope sessions back. Every agent now declares how its cwd is found without a full parse, and the scan selects in-scope sessions before the recency cap: Codex and other header agents by their opening record, SQLite stores by their directory column, the rest by their cached parse. The scan and the cached-list cut share one scope rule.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
99929098-7ad9-4e78-9e5d-85205a52e44d
📒 Files selected for processing: 27
src/main/ai-vault/session-cwd-bucket-layouts.tssrc/main/ai-vault/session-newest-files.tssrc/main/ai-vault/session-parse-cache-store.tssrc/main/ai-vault/session-scanner-antigravity-sources.tssrc/main/ai-vault/session-scanner-candidate-parse.tssrc/main/ai-vault/session-scanner-candidates.tssrc/main/ai-vault/session-scanner-discovery.tssrc/main/ai-vault/session-scanner-opencode-sources.tssrc/main/ai-vault/session-scanner-opencode-sqlite-discovery.tssrc/main/ai-vault/session-scanner-opencode-sqlite-dispatch.tssrc/main/ai-vault/session-scanner-opencode-sqlite-list.tssrc/main/ai-vault/session-scanner-opencode-sqlite-worker-client.tssrc/main/ai-vault/session-scanner-opencode-sqlite-worker-protocol.tssrc/main/ai-vault/session-scanner-opencode-sqlite-worker-spawn.tssrc/main/ai-vault/session-scanner-opencode-sqlite.test.tssrc/main/ai-vault/session-scanner-opencode2-sqlite-list.tssrc/main/ai-vault/session-scanner-scope-discovery.tssrc/main/ai-vault/session-scanner-scope-walk.test.tssrc/main/ai-vault/session-scanner-scope-walk.tssrc/main/ai-vault/session-scanner-source-discovery.tssrc/main/ai-vault/session-scanner-sqlite-scope-rows.tssrc/main/ai-vault/session-scanner-types.tssrc/main/ai-vault/session-scanner-zcode-sources.tssrc/main/ai-vault/session-scanner.tssrc/main/ai-vault/session-scope-cwd.tssrc/shared/ai-vault-scope-cwd-match.tssrc/shared/ai-vault-session-depth.ts
💤 Files with no reviewable changes: 1
- src/main/ai-vault/session-cwd-bucket-layouts.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
|
Agent Session History could hide a workspace’s older conversations when newer sessions from unrelated folders filled the 250-session limit. Workspace and Project now select matching history before spending their limit, through discovery, caches and All computers aggregation. Existing row actions and setup paths stay on their current paths. Five review rounds are complete. The final main merge was checked narrowly on The loop fixed selected Workspace requests, aggregation, Antigravity enrichment, activity ordering, WSL identity and Project attribution, database error reporting, cancellation yields, cold/cached result limits and temporary false-empty presentation. Its last repair keeps current parsed metadata authoritative when Cursor metadata appears or a Codex parse leaves memory. Both regressions failed on the earlier performance patch and passed on the reviewed repair. No open P0/P1 or new proven merge issue remains. Validation on the merged head:
Matched Windows measurements on the reviewed scanner, 20,000 Codex transcripts and production event-loop yields: first scoped open 2.19–2.27 seconds, warm 0.235–0.243 seconds, busy 0.257–0.260 seconds, and after memory reset 2.23–2.25 seconds. The approved earlier baseline was 3.55–3.56 seconds first open and 3.59–3.70 seconds after reset; warm performance is similar. The final merge leaves those scanner files unchanged. These measurements were not repeated on the merge and are not latency or memory bounds. Intended limits remain: sparse scopes may inspect all discovered files or database metadata rows; an uncached session that moved after its opening record can remain missing until parsed; Gemini records no directory; All retains its existing supplements; older execution hosts retain their existing coverage. No new saved field, external operation or minimum peer version is introduced. The inherited cutoff assumes activity does not exceed transcript modification time; rewritten timestamps outside that contract remain deferred. No temporary second membership authority remains. For Brennan’s review Fresh real Electron QA compared pinned main
Workspace A retained both conversations exactly once after Refresh. Project’s empty folder view is pre-existing, tracked in STA-10957. All’s extra rows and Workspace C’s matching supplement are intended. The strip, count bar and list top moved 0 pixels across 55 main and 68 merged rendered frames spanning refresh and workspace switching, including loading frames. The strip stayed at y=161.5, the count bar at y=194.5, and the list at y=226.5. No rows from the wrong workspace appeared. This is sampled evidence, not a guarantee against every sub-frame condition. First-ever loading has a different count-bar state and is not covered by that geometry claim. The QA worker inspected all 22 full-window captures; 13 were uploaded. All recorded app/daemon descendants exited and assigned ports were clear. The five established real-config fingerprints stayed unchanged through every app interval and final cleanup. A later check found an unattributed Codex config change after all test processes had exited; two account-local hooks files were discovered only at the end and lack before-run hashes. Those are explicit evidence limits, not a claim that all final real configuration stayed unchanged. No config contents were copied, inspected or restored. This short rerun did not inject error/partial-scan banners or exercise resume, whole-app restart, setup/default tabs, All computers, other providers, live WSL/SSH, older peers, or large-corpus memory. Error/banner interaction was checked in source and the named tests. Prior screenshots and timings are historical; the images above show the merged head. Judgment points:
|
…history-scope-before-cap # Conflicts: # src/main/ai-vault/session-scanner.ts
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bcb6826c-9561-45fa-a0bb-28b77de8545e
📒 Files selected for processing: 2
src/main/ai-vault/session-scanner-candidate-parse.tssrc/main/ai-vault/session-scanner.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
…a per-file read A scoped scan walks every transcript, and each one cost an await, a parse-cache database lookup and, for Codex, two head reads every scan. Remember each file version's settled cwd (from its opening records or its parse), drop settled out-of-scope files synchronously before the async walk, and read Codex's roughly 20 KB first record in one 64 KB read.
…ipt heads The settled-cwd prefilter let a transcript-only verdict reject files whose current parse (hot or cold) says otherwise: a Cursor chat whose meta.json appeared later, or a Codex session whose parsed latest cwd moved after its row left memory. Restore parse-cache-first selection; keep Codex's single 64 KB first read.
…history-scope-before-cap # Conflicts: # src/renderer/src/components/right-sidebar/ai-vault-session-refresh.ts
Resolution groups: 1. Revert-caused conflicts (29 files under acp, ai-vault, native-chat, pi, claude, codex, runtime/rpc, renderer ai-vault, shared ai-vault, mobile picker): upstream side taken. Our side carried only upstream release-branch commits there (2213562, c361d26, bb20d8f, 42e1469), none of ours. Files deleted on one side follow upstream (3 restored, 3 removed). Also aligned to v1.4.232: 40 files that auto-merged but still carried the stablyai#29977 revert (c361d26) or a duplicated stablyai#30436 test block (bb20d8f); no fork or PR commit touches them. 2. package.json: upstream (version 1.4.232); no own change on our side. 3. cloud-operate-relay-production-reserve-watch.yml: upstream. 5974258 is an upstream "match main's workflow files" commit; .github now equals v1.4.232. 4. src/main/updater/updater-setup.ts: upstream structure (macOS ShipIt scheduling, stablyai#30944) plus our kill-switch import; the early returns in both check entry points and setupAutoUpdater auto-merged unchanged.













ELI5
Agent Session History could lose a workspace's older conversations because newer sessions from other folders filled the list first. Workspace and Project now select matching conversations before spending their history limit.
What Changed
A workspace with about twelve Codex conversations showed only one after 1,493 newer transcripts appeared elsewhere. The same omission affected agents whose files were outside the existing folder-based lookup.
Every agent now declares how its session directory is discovered. The scanner reuses its parser, enrichment, ordering, cancellation and deduplication while selecting scoped history. Database-backed sources filter ordered metadata before admitting rows. Workspace requests its own paths; Project and All retain their existing broader project paths and supplements. Scope-preserving trimming also reaches caches and All computers, and WSL membership retains distro identity through Project attribution.
Why
The common pattern applies folder membership before the page limit. Applying that rule throughout the existing listing path removes the repeated omission class; raising the global cap or adding another agent-specific exception would leave it intact.
Intended differences and limits:
Linked Issue
N/A — maintainer-reported missing history.
Visual Proof
Fresh real Electron QA on the M4Air compared exact branch
acac1452b1cwith its pinned main baseline30e3119fc75, using two genuine old Codex conversations plus 270 newer unrelated transcripts, default history depth 250. Both builds used separate throwaway homes and were rebuilt for this comparison.Workspace shows neither genuine conversation on main and both exactly once on the branch. Explicit refresh and closing/reopening history preserve both (branch after reopening). Project is empty on both in this folder workspace, the pre-existing gap tracked in STA-10957. All's 252 rows at depth 250 are the intended existing scoped supplement.
All five real configuration fingerprints stayed unchanged across 24 checkpoints spanning preparation, builds, launches, UI driving, shutdown and final cleanup. The QA worker inspected every capture, actual app identity, isolation environment and keychain flags. The existing signed-in Codex worker drove through CDP under the approved driver exception; no credentials were copied or new sign-in performed. All recorded app processes and descendants exited and ports 9420/9421 were clear.
Testing
The full PR workflow, including aggregate job 117529796173, passed on exact head
acac1452b1c07c74fd749d600ba45fb19b833c87. Windows regression verification reproduced both new failures on d5 and passed them on this head; seven related named files passed 98/98. Earlier Windows coverage passed 216 tests in 25 named files and 76 tests in three files after fixture corrections.The two regressions cover an unchanged Cursor transcript gaining workspace metadata and a Codex conversation whose latest parsed directory must survive memory-cache eviction. Both now consult current parsed metadata before an opening-record shortcut can exclude the conversation. Codex retains the single bounded 64 KiB first read.
Matched Windows measurements on 20,000 Codex files, two fresh processes with production event-loop yields: scoped first open 2.19–2.27 s (193 baseline 3.55–3.56 s), warm 0.235–0.243 s (baseline 0.228–0.233 s), busy about 0.26 s, and after memory reset 2.23–2.25 s. All three older matching sessions remain present. This fixture has no persistent SQLite cold tier; database latency, live WSL/SSH, cancellation timing and general memory bounds remain unmeasured.
In real Electron on 272 files, branch first open settled in 365 ms with a 119 ms host scan; warm refresh settled in 53 ms with a 10 ms host scan. Main cold timing was not captured. Session resume, full app restart, All computers and old peers were not exercised in this short QA.
Review
Five review rounds total: three full rounds, the performance delta, and one bounded verification of its frozen repair. The last reviewer agreed both authority regressions are fixed, verified the exact tree and 103 production / 102 test touches, and found no new issue. Final readiness covered all eight areas plus a separate six-question performance pass; no new proven candidate remained. The inherited timestamp-cutoff limitation remains deferred; no further fix or architecture round was added.
Agent skill upstream boundary
Notes
Execution stays on the host that owns the sessions. Folder workspaces remain supported. WSL database requests use the existing distro boundary and additive internal scope field; no response shape or stream operation changes.
Checklist