Repository navigation
feat(session-history): add local search settings and index controls - #20582
Conversation
There was a problem hiding this comment.
ℹ️ No critical issues — one minor suggestion inline.
Reviewed changes
- Settings pane (new):
SessionHistorySettingsPane.tsxadds the opt-in toggle, All/90/30-day retention select, desktop-only clear button, and inline save/clear errors, wired into the settings nav and page renderers. - Index status (new):
SessionHistoryIndexStatus.tsxreadssearchStatus('local')and polls every 5s only while enabled, visible, and the backend reportsindexing; terminal/error states stop the loop and a Refresh/open re-observes. - Clear index (new backend path):
searchClearadded to the scanner-child protocol and handled bySessionScannerServiceSearchviaSessionSearchInstance.clear()(close → remove DB + sidecars → rebuild only if consent remains), exposed through a new desktop-onlyaiVault:clearSearchIndexIPC with a rejecting web stub. - Cursor incarnation fencing: an
index_incarnationUUID is seeded withINSERT OR IGNOREand embedded in the opaque cursor, so legacy cursors and pre-clear cursors are refused even when the rebuilt generation counter matches. - Surrounding: contract doc update,
sessionHistoryEnglish strings, and focused tests for the pane, cursor rebuild, and IPC locality.
I read the full diff and ran the affected tests (82 main-process tests across 7 files, plus the 10-case pane test), all green; verify:localization-extraction and verify:localization-catalog also pass. The incarnation design holds across the open/reopen/rebuild paths I traced, and the new tests are falsifiable rather than tautological.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
The only delta since the prior pullfrog review is the follow-up commit 45fef664f7, which resolves the single inline finding from that review.
- Local host id via shared constant:
SessionHistoryIndexStatusnow importsLOCAL_EXECUTION_HOST_IDfromsrc/shared/execution-hostand passes it towindow.api.aiVault.searchStatus(...)instead of the'local'literal — a no-op at runtime (LOCAL_EXECUTION_HOST_ID === 'local'), matching the rest of the renderer's host-id usage and preventing drift if the id ever changes.
No behavioral surface changed; the import path follows the existing ../../../../shared/execution-host convention used elsewhere at this depth. The prior thread is now resolved.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
45fef66 to
73b6d02
Compare
|
Rebased onto main now that #20516 (3b) is merged as |
|
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:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe session-search index now stores a persistent incarnation UUID and includes it in pagination cursors. Searches reject cursors from older incarnations. The scanner service, IPC bridge, and preload API now support clearing the desktop-local index. Settings now include session-history enablement, live status polling, and advanced index-deletion controls. Browser preload behavior reports that clearing is unavailable. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to This change lets users search local agent session history, but the settings panel currently ships without any way to choose how much history is retained (All/90/30 days), even though the feature description and screenshots promise that control; users are stuck with whatever value is already stored. Separately, a malformed session-search cursor with a non-string incarnation field is misclassified as a stale-generation error instead of the documented malformed-cursor error, a narrow edge case. The missing retention control should be resolved before merging. 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (3 warnings)
✅ Passed checks (2 passed)
Full details: Description checkExplanation The description provides detailed change context, rationale, visual evidence, testing results, compatibility scope, known gaps, and review notes. However, it does not follow the required template structure and omits an explicit Linked Issue section with a Resolution Reformat the description using all required template headings. Add the linked issue in the required Full details: Out of Scope Changes checkExplanation Issue Full details: Docstring CoverageExplanation Docstring coverage is 18.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 27 functions across 25 files. (1 skipped: 1 unsupported.) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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: a9064f8c-9525-4f10-a294-cea2671ad1cf
📒 Files selected for processing (26)
docs/reference/agent-session-search-contract.mdsrc/main/ai-vault-search/session-search-engine.tssrc/main/ai-vault-search/session-search-index-generation.test.tssrc/main/ai-vault-search/session-search-index-generation.tssrc/main/ai-vault-search/session-search-instance.test.tssrc/main/ai-vault-search/session-search-page-cursor.tssrc/main/ai-vault-search/session-search-paging.test.tssrc/main/ai-vault-search/session-search-schema.tssrc/main/ai-vault/session-scanner-service-protocol.tssrc/main/ai-vault/session-scanner-service-search-roots.test.tssrc/main/ai-vault/session-scanner-service-search.test.tssrc/main/ai-vault/session-scanner-service-search.tssrc/main/ai-vault/session-scanner-service-spawn.tssrc/main/ipc/ai-vault-search.test.tssrc/main/ipc/ai-vault-search.tssrc/preload/api/ai-vault-api.tssrc/preload/api/ai-vault-bridge.tssrc/renderer/src/components/settings/SessionHistoryIndexStatus.tsxsrc/renderer/src/components/settings/SessionHistorySettingsPane.test.tsxsrc/renderer/src/components/settings/SessionHistorySettingsPane.tsxsrc/renderer/src/components/settings/settings-page-renderer.tsxsrc/renderer/src/components/settings/settings-setup-workflow-section-renderers.tsxsrc/renderer/src/hooks/settings-navigation-workflow-sections.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/settings-navigation-types.tssrc/renderer/src/web/preload-api/web-ai-vault-api.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.
| if (payload.i !== incarnation) { | ||
| throw new SessionSearchCursorError('stale-generation', generation, claimed) | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject a non-string incarnation as malformed.
A cursor such as {"i":null,"g":7,"o":1,"k":"k"} reaches this branch and returns stale-generation. Its i field is malformed, not a legacy cursor. Preserve the stale result for an absent i, but validate a present i as a string with the other payload fields.
As per the contract documentation, malformed cursors must yield malformed-cursor.
There was a problem hiding this comment.
ℹ️ No critical issues — the new behavior is sound; one contract-doc drift and a couple of copy nits.
Reviewed changes
The delta since the prior pullfrog review is bbd2eff615 ("live index status, enable confirm, advanced delete"); the two commits beneath it were a patch-identical rebase already covered.
- Live index status:
SessionHistoryIndexStatusdrops the Refresh button andbusyprop and now polls while the pane is enabled and visible — 2s while a sweep still has files due, 10s once settled — deriving copy throughisSweeping/sweepMessage/statusMessage. - Enable consent: turning search on routes through a confirmation dialog (declining leaves it off); turning it off saves directly. The All/90/30-day retention
Selectis removed, but the storedhistoryDayspolicy is preserved on every save. - Advanced delete: the clear control moves behind an
Advancedcollapsible, relabeled "Delete index" with updated confirmation copy; still confirmation-gated and desktop-only. - Tests: new
SessionHistoryIndexStatus.test.tsx(10 cases) plus reworked pane tests cover polling cadence, phase copy, degraded/unreadable copy, pending-response fencing, unmount, failed reads, and the consent/decline paths. - Strings:
sessionHistorycatalog updated for the new copy.
ℹ️ Nitpicks
sessionHistory.settings.clearedandclearErrorstill read "Search index cleared" / "Could not clear the index" after the action was renamed to Delete index — align them with the new label.sessionHistory.status.unreadablerenders "1 files could not be read" for a single failed file.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| Disabling closes the indexer and keeps the index copy; clearing deletes the copy. | ||
| Changing retention reuses the existing close-and-construct policy application. | ||
| The settings pane reads status only while enabled and visible, polls only an | ||
| observed indexing phase, and stops on completion or error. Opening the pane, | ||
| changing policy, or pressing Refresh obtains a new observation. The indexer's own | ||
| schedule does not depend on the pane. |
There was a problem hiding this comment.
This paragraph still describes the pre-bbd2eff615 pane. The Refresh control was removed and polling no longer stops on completion — it now keeps polling a settled index (2s while files are due, 10s otherwise) — and the retention control was removed, so "Changing retention ... close-and-construct" and "pressing Refresh" are no longer reachable from this surface.
Technical details
# Contract doc describes removed controls and old polling behavior
## Affected sites
- `docs/reference/agent-session-search-contract.md:160-165` — says polling "stops on completion or error", references a Refresh button, and says retention changes route through close-and-construct.
- `src/renderer/src/components/settings/SessionHistoryIndexStatus.tsx:9-100` — removed Refresh; `SWEEPING_POLL_MS`/`SETTLED_POLL_MS` keep the loop alive while enabled and visible.
- `src/renderer/src/components/settings/SessionHistorySettingsPane.tsx:137-199` — retention `Select` removed; clear renamed Delete and moved behind Advanced.
## Required outcome
- The paragraph matches the shipped behavior, or the behavior is restored. Also update the PR body, which still advertises "All / 90 / 30-day history", "polls only while the host reports indexing", and a "do not merge / targeting #20516" dependency note.| Disabling closes the indexer and keeps the index copy; clearing deletes the copy. | |
| Changing retention reuses the existing close-and-construct policy application. | |
| The settings pane reads status only while enabled and visible, polls only an | |
| observed indexing phase, and stops on completion or error. Opening the pane, | |
| changing policy, or pressing Refresh obtains a new observation. The indexer's own | |
| schedule does not depend on the pane. | |
| Disabling closes the indexer and keeps the index copy; deleting deletes the copy. | |
| The persisted retention window (`historyDays`) still bounds the index, but this | |
| pane no longer exposes a control for it. The settings pane reads status only while | |
| enabled and visible and keeps polling — faster while a sweep has files due, slower | |
| once settled — so counts stay live between sweeps. Opening the pane or changing | |
| policy obtains a new observation. The indexer's own schedule does not depend on the | |
| pane. |
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: ce0a419a-8e98-4caa-ae67-907bd30343c0
📒 Files selected for processing (6)
src/renderer/src/components/settings/SessionHistoryIndexStatus.test.tsxsrc/renderer/src/components/settings/SessionHistoryIndexStatus.tsxsrc/renderer/src/components/settings/SessionHistorySettingsPane.test.tsxsrc/renderer/src/components/settings/SessionHistorySettingsPane.tsxsrc/renderer/src/hooks/settings-navigation-workflow-sections.tssrc/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
- src/renderer/src/hooks/settings-navigation-workflow-sections.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| onChange={() => void toggleEnabled()} | ||
| /> | ||
| {!isWebClient ? ( | ||
| <SessionHistoryIndexStatus enabled={policy.enabled} refresh={refresh} /> |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Restore the retention selector.
The stated feature includes All, 90-day, and 30-day retention choices. This pane now skips that control and only preserves an existing historyDays value during save. Users cannot set or change retention.
Restore the selector and update the test that currently asserts it is absent.
Based on PR objectives: the pane must provide All/90/30-day retention choices.
…gs-ui # Conflicts: # src/renderer/src/i18n/locales/en.json
There was a problem hiding this comment.
ℹ️ No critical issues — one minor styling suggestion inline.
Reviewed changes
The delta since the prior pullfrog review is e46cd2da35 ("let Button and Collapsible own their spacing and type"), a three-line presentational change to SessionHistorySettingsPane.tsx.
- Advanced toggle uses the
xsbutton size:size="sm"+ thetext-xsoverride is replaced bysize="xs", letting theButtonprimitive own the type scale (button.tsx:23). - Disclosure spacing moved to the container: the
Collapsibleswitched frompt-2tomt-2. - Expand/collapse animation dropped:
CollapsibleContentno longer carries the sharedcollapsible-height-contentutility.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| /> | ||
| </Button> | ||
| </CollapsibleTrigger> | ||
| <CollapsibleContent> |
There was a problem hiding this comment.
Every other settings disclosure wraps its content in the shared collapsible-height-content utility (e.g. SshHostAdvancedFields.tsx:42, LocalNetworkConnectionTest.tsx:141), which is what supplies the open/close animation, and docs/STYLEGUIDE.md:267 asks expanding/collapsing content to be animated. Dropping it here makes the Advanced section snap open and closed instead. Was that intentional — if not, restore the class?
…gs-hosts-2 Re-applies this branch's deletion of SessionHistoryIndexStatus. The squash of #20582 added that component to main with no history this branch shares, so the merge saw an add on one side and resurrected a file 33f0444 had removed. It is unreachable here and reads eleven `sessionHistory` keys the redesign dropped, so keeping it would red the localization gates.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, stablyai#20986), so that layer is now upstream's: `searchAllExecutionHosts` over `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…tablyai#20582) * feat(session-history): add local search settings and index controls * Use shared local host identifier for session index status * feat(settings): live index status, enable confirm, advanced delete * fix(settings): let Button and Collapsible own their spacing and type
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.
…on index Agent Session History was a filesystem walk plus a parse of every transcript it found, so one load cost O(corpus) in readdirs, stats and reads on every scan. The index already holds one row per session with everything a row renders, so a list is now one indexed read. The scanner stays as the fallback for a host where no pass has completed or `node:sqlite` is absent, and it now applies the same plain-text query the index would, because an unfiltered answer would read as "everything matches". Search gains a metadata tier: - Metadata (a `sessions` row plus `sessions_fts` over titles, working directories, branches and agent names) is always indexed and answers with `evidence: null` — there is no transcript text to quote and none is fabricated. Content (`messages`, `messages_fts`) stays opt-in. The pre-tier `enabled` flag named that same consent, so a profile that recorded it keeps it as `contentEnabled` rather than having the question silently re-opened, and `status.enabled` now means only that an index exists and runs. The index writer takes that consent as `storeContent`, so a metadata-only index stores no message rows at all rather than storing and hiding them, and drops the `sessions_fts` row wherever it drops the session row. The scanner service protocol grows `refresh` and `query` so a host can answer the panel's list itself; both sides call `aiVaultHostListQuery`, so what the client sends and what the host accepts cannot drift. Remote scanning gains a Copilot source that walks a session directory without descending into the artifact trees beside `events.jsonl`, which hold no sessions and cost a readdir each. Rebased onto upstream 2026-09-18. Upstream landed its own all-computers search merge in these same files (stablyai#20582, stablyai#20753, stablyai#20754, stablyai#20870, stablyai#20886, stablyai#20887, `SessionSearchHostLeg`s, walking each host page by page and merging on recency and round-robin ranking with an encoded merged cursor. This commit's own fan-out was dropped rather than left to diverge with it — `ai-vault-search-all-hosts.ts`, `-host-fanout.ts` and their tests now follow upstream, and the fork's `ai-vault-search-merged-order.ts`, `ai-vault-search-status-aggregation.ts`, `session-search-rank-fusion.ts` and their tests are gone. What survives is what upstream has no equivalent of: the metadata FTS tier, the indexed list, the service `query`/`refresh` protocol, and the Copilot source. `contentEnabled` stays as an additive, optional status field. Re-porting per-host status vocabularies and reciprocal-rank fusion onto upstream's engine is deliberately left open, not lost. Wire compatibility: `contentEnabled` is additive and optional, so an older peer ignores it, and a host that predates the list `query` answers the scan request it already understood. See docs/reference/agent-session-search-contract.md and docs/reference/remote-wire-compatibility.md.

Agent Session History now has a searchable Settings pane for this computer: opt-in (default OFF), All / 90 / 30-day history, index status, and confirmed clear-index. It uses the existing settings normalization/schema and persistence. Disabling keeps the index copy; clearing removes only that copy and rebuilds it when enabled. Original transcripts remain untouched.
Clear runs in the scanner child's existing interactive lane through its close/remove/reconstruct lifecycle. A database identity in opaque cursors prevents pre-clear pages being accepted after a rebuild reuses the same numeric generation. Public search/status request and response schemas are unchanged.
Status refreshes only in the visible, enabled pane and polls only while the host reports indexing. Idle/error states have no polling loop. No status-bar segment was added: without a shared status feed it would add an idle timer or a redundant enabled indicator. Indexer scheduling remains independent of the UI.
Scope and compatibility:
sessionHistory; existing translations use fallback rather than fabricated translations.Validation:
tc:web/tc:node, changed-code quality, formatting, and localization catalog/runtime/extraction/coverage checks passed.ORCA_BACKGROUND_LAUNCH=1, Playwright CDP, and two synthetic transcripts. Verified opt-in/search, All→30-day retention, enabled clear/rebuild, disabled clear with database/sidecars absent and source files retained, failed clear/readiness with a read-only synthetic index directory, retry, and persisted policy after reload. Inspected full screenshots in dark/light modes, including 1100×850.Dependencies: this draft deliberately targets
session-search-pr3b-wiring(#20516), head9845bef63a6. Do not merge yet. The user will merge prerequisites and explicitly request rebase onto main. CLI #20514 is an independent consumer, not a dependency. Windows numeric file-ID fix #20551 is not duplicated here; no local overlay was needed, and it will arrive on the later rebase. The split-plan document was absent from this base/named refs; the explicit PR8 brief and live contracts governed the implementation.Review:
gpt-6-astra, medium reasoning, reviewed the full incremental diff after implementation and checks with the requested YAGNI/cognitive-load direction. No substantive correctness findings or blockers; it recommended keeping the existing structure. One optional test-label concern was corrected (the test proves unmount fencing, not the renderer’s policy-key wiring). No substantive fixes requiring rereview were identified.Rendered settings and failure evidence