Skip to content

feat(session-history): add local search settings and index controls - #20582

Merged
Jinwoo-H merged 7 commits into
mainfrom
session-search-settings-ui
Sep 16, 2026
Merged

Jinwoo-H merged 7 commits into
mainfrom
session-search-settings-ui

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​501 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​494
Prod 19 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​536 $\color{#cf222e}{\Huge{\mathbf{−}}}$​17 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​519

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:

  • Controls explicitly own this computer, even with a remote runtime selected. Paired controls are unsupported; no remote enable/clear method or capability was added. SSH relay consent remains OFF.
  • PR7 panel/search/consent/resume surfaces are untouched. No watchers, redaction, pause/resume, size endpoint, duplicate scheduler, or changed indexing limits.
  • English strings are isolated under sessionHistory; existing translations use fallback rather than fabricated translations.

Validation:

  • Focused settings/race, navigation/language, schema, IPC locality, real scanner-child lifecycle, cursor rebuild and paging tests passed: 171 tests in 13 files; paging rerun passed 32 tests after simplification.
  • Affected tc:web / tc:node, changed-code quality, formatting, and localization catalog/runtime/extraction/coverage checks passed.
  • Real Electron UI → IPC → scanner checks used this worktree's isolated profile/home and ports, 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.
  • Remaining gaps: native Windows/Linux/WSL UI runs, real SSH/paired deployments, transport-failure screenshots and non-English visual review. These are synthetic local integration checks, not full cross-platform E2E.

Dependencies: this draft deliberately targets session-search-pr3b-wiring (#20516), head 9845bef63a6. 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

pr8-light-1100.png
pr8-clear-failed.png

@Jinwoo-H
Jinwoo-H marked this pull request as ready for review September 14, 2026 15:44

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues — one minor suggestion inline.

Reviewed changes

  • Settings pane (new): SessionHistorySettingsPane.tsx adds 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.tsx reads searchStatus('local') and polls every 5s only while enabled, visible, and the backend reports indexing; terminal/error states stop the loop and a Refresh/open re-observes.
  • Clear index (new backend path): searchClear added to the scanner-child protocol and handled by SessionScannerServiceSearch via SessionSearchInstance.clear() (close → remove DB + sidecars → rebuild only if consent remains), exposed through a new desktop-only aiVault:clearSearchIndex IPC with a rejecting web stub.
  • Cursor incarnation fencing: an index_incarnation UUID is seeded with INSERT OR IGNORE and 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, sessionHistory English 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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: SessionHistoryIndexStatus now imports LOCAL_EXECUTION_HOST_ID from src/shared/execution-host and passes it to window.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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@Jinwoo-H
Jinwoo-H force-pushed the session-search-settings-ui branch from 45fef66 to 73b6d02 Compare September 14, 2026 18:07
@Jinwoo-H
Jinwoo-H changed the base branch from session-search-pr3b-wiring to main September 14, 2026 18:07
@Jinwoo-H

Copy link
Copy Markdown
Contributor Author

Rebased onto main now that #20516 (3b) is merged as eba56f2f69, dropping the squashed 3b commits, and retargeted to main. Gates on the rebased head: pnpm tc, changed tests, check:code-quality:changed, check:react-doctor:changed all pass. The base note in the description is superseded.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 3b045b82-e076-4194-8dc2-3cdfc69834f0

📥 Commits

Reviewing files that changed from the base of the PR and between e46cd2d and 5ebd83d.

📒 Files selected for processing (1)
  • src/renderer/src/i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/i18n/locales/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The 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 5ebd8

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)

Check name Status Explanation Resolution
Description check ⚠️ Warning 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 stru… Reformat the description using all required template headings. Add the linked issue in the required Fixes #... format, complete or explicitly mark the Testing, AI Disclosure, Agent skill upstream boundary, Notes, and Checklist sections, a…
Out of Scope Changes check ⚠️ Warning Issue #20551 covers oversized SQLite file IDs on Windows. This pull request also changes Agent Session History settings, consent UI, status polling, clear-index IPC and scanner operations, cursor inca… Remove the unrelated settings, clear-index, cursor-incarnation, localization, documentation, and test changes from this pull request, or link them to an issue that requires this work and submit the changes separately.
Docstring Coverage ⚠️ Warning 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:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: local session-history search settings and index controls.
Linked Issues check ✅ Passed Issue #20551 requires safe reads of both dev and ino at the session-search read sites. The reviewed head uses CAST(dev AS REAL) and CAST(ino AS REAL) in SessionSearchStore.files() and `Sessi…
Full details: Description check

Explanation

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 Fixes #... entry, the checklist items, and the Agent skill upstream boundary declaration.

Resolution

Reformat the description using all required template headings. Add the linked issue in the required Fixes #... format, complete or explicitly mark the Testing, AI Disclosure, Agent skill upstream boundary, Notes, and Checklist sections, and retain the existing visual proof and testing details.

Full details: Out of Scope Changes check

Explanation

Issue #20551 covers oversized SQLite file IDs on Windows. This pull request also changes Agent Session History settings, consent UI, status polling, clear-index IPC and scanner operations, cursor incarnation handling, localization, documentation, and related tests. These changes do not support the numeric file-ID fix.

Full details: Docstring Coverage

Explanation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: a9064f8c-9525-4f10-a294-cea2671ad1cf

📥 Commits

Reviewing files that changed from the base of the PR and between c6a7216 and 73b6d02.

📒 Files selected for processing (26)
  • docs/reference/agent-session-search-contract.md
  • src/main/ai-vault-search/session-search-engine.ts
  • src/main/ai-vault-search/session-search-index-generation.test.ts
  • src/main/ai-vault-search/session-search-index-generation.ts
  • src/main/ai-vault-search/session-search-instance.test.ts
  • src/main/ai-vault-search/session-search-page-cursor.ts
  • src/main/ai-vault-search/session-search-paging.test.ts
  • src/main/ai-vault-search/session-search-schema.ts
  • src/main/ai-vault/session-scanner-service-protocol.ts
  • src/main/ai-vault/session-scanner-service-search-roots.test.ts
  • src/main/ai-vault/session-scanner-service-search.test.ts
  • src/main/ai-vault/session-scanner-service-search.ts
  • src/main/ai-vault/session-scanner-service-spawn.ts
  • src/main/ipc/ai-vault-search.test.ts
  • src/main/ipc/ai-vault-search.ts
  • src/preload/api/ai-vault-api.ts
  • src/preload/api/ai-vault-bridge.ts
  • src/renderer/src/components/settings/SessionHistoryIndexStatus.tsx
  • src/renderer/src/components/settings/SessionHistorySettingsPane.test.tsx
  • src/renderer/src/components/settings/SessionHistorySettingsPane.tsx
  • src/renderer/src/components/settings/settings-page-renderer.tsx
  • src/renderer/src/components/settings/settings-setup-workflow-section-renderers.tsx
  • src/renderer/src/hooks/settings-navigation-workflow-sections.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/settings-navigation-types.ts
  • src/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.

Comment on lines +108 to +110
if (payload.i !== incarnation) {
throw new SessionSearchCursorError('stale-generation', generation, claimed)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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: SessionHistoryIndexStatus drops the Refresh button and busy prop and now polls while the pane is enabled and visible — 2s while a sweep still has files due, 10s once settled — deriving copy through isSweeping/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 Select is removed, but the stored historyDays policy is preserved on every save.
  • Advanced delete: the clear control moves behind an Advanced collapsible, 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: sessionHistory catalog updated for the new copy.

ℹ️ Nitpicks

  • sessionHistory.settings.cleared and clearError still 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.unreadable renders "1 files could not be read" for a single failed file.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Comment on lines +160 to +165
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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Suggested change
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: ce0a419a-8e98-4caa-ae67-907bd30343c0

📥 Commits

Reviewing files that changed from the base of the PR and between 73b6d02 and bbd2eff.

📒 Files selected for processing (6)
  • src/renderer/src/components/settings/SessionHistoryIndexStatus.test.tsx
  • src/renderer/src/components/settings/SessionHistoryIndexStatus.tsx
  • src/renderer/src/components/settings/SessionHistorySettingsPane.test.tsx
  • src/renderer/src/components/settings/SessionHistorySettingsPane.tsx
  • src/renderer/src/hooks/settings-navigation-workflow-sections.ts
  • src/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} />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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 xs button size: size="sm" + the text-xs override is replaced by size="xs", letting the Button primitive own the type scale (button.tsx:23).
  • Disclosure spacing moved to the container: the Collapsible switched from pt-2 to mt-2.
  • Expand/collapse animation dropped: CollapsibleContent no longer carries the shared collapsible-height-content utility.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

/>
</Button>
</CollapsibleTrigger>
<CollapsibleContent>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@Jinwoo-H
Jinwoo-H merged commit dec0e2c into main Sep 16, 2026
28 checks passed
Jinwoo-H added a commit that referenced this pull request Sep 16, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 18, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 19, 2026
…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.
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…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
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 21, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 22, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 25, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 27, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Sep 29, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Oct 1, 2026
…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.
nplez1 added a commit to nplez1/orca that referenced this pull request Oct 6, 2026
…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.
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