Repository navigation
feat(session-search): add panel search and opt-in consent (PR7) - #20580
Conversation
There was a problem hiding this comment.
ℹ️ No critical or blocking issues — one minor UX suggestion inline. The search state machine and the source-availability gating both held up under independent review, and
pnpm tc:webplus the focused unit tests pass on this checkout.
Reviewed changes
- Indexed panel search.
useAiVaultPanelSearch/useAiVaultSearchdebounce a single request per host/query/policy identity, fence late responses, restart page 1 once on a stale cursor, and page withloadMore; a non-empty query swaps the panel ontosearch.sessionsand a single "Best matches" group. - Opt-in consent.
AiVaultPanelSearchoffers Enable/Not now only for a local, non-web scope withaiVaultSearchoff, writes the existing global setting, and gives explicit copy for all-hosts, remote disabled/not-ready/no-service, transport error, stale/malformed cursor, truncation, and no matches. - Hit-to-row mapping and gated actions.
aiVaultSearchHitToSessionmaps only host-provided fields;canResumeAiVaultSearchHit/hasAiVaultSearchHitPathgate resume, drag, copy-path, open/reveal log, open-cwd and delete so withheld/unverifiable sources cannot act, while history rows (searchHitsundefined) keep every prior action. - Evidence rendering.
[[...]]markers render as React text (no HTML injection), only paired markers are<mark>ed, and unverifiable/missing transcripts are stated honestly; evidence is shown in both collapsed and expanded search rows. - Delete consistency.
useAiVaultSessionDeleteActiongainedonDeleted, so a confirmed deletion removes the hit immediately without re-querying a potentially stale index. - Tests. 15 new focused unit tests across the hook state machine, hit mapping, evidence, and row behavior, plus a hidden-Electron e2e spec.
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 test-only CI follow-up in e61aa592.
- Stabilized the hidden-Electron search spec.
tests/e2e/ai-vault-panel-search.spec.tsnow waits forsearchStatus('local').filesIndexed > 0(30s poll) before clickingRefresh Session History, instead of racing the index sweep by asserting the highlighted row first. The refresh click routes tosearch.retry()whilesearching(AiVaultPanel.tsxonRefresh), so the assertion still fails if the retry/search path regresses. No production code changed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
e61aa59 to
a59cd23
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 (2)
💤 Files with no reviewable changes (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; 7 remain after this review. 📝 WalkthroughWalkthroughAdds AI Vault session search with debounced, paginated requests, retry handling, consent prompts, and unavailable-state messages. Search results map to sessions and display highlighted evidence. Resume, path, and deletion actions depend on source availability. The panel changes its header, controls, list rendering, and deletion behavior during search. Tests cover hook state, evidence rendering, row behavior, and end-to-end search flows. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No concrete merge-blocking issue remains in the supplied review evidence. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Out of Scope Changes checkExplanation Issue Resolution Link the history-search feature issue to this pull request, or remove the unrelated search UI, consent, hook, pagination, highlighting, session-row, localization, and end-to-end feature changes. Keep this pull request limited to the Full details: Docstring CoverageExplanation Docstring coverage is 4.17% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 19 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
# Conflicts: # src/renderer/src/components/right-sidebar/AiVaultSessionRow.test.tsx # src/renderer/src/components/right-sidebar/AiVaultSessionVirtualList.tsx # src/renderer/src/i18n/locales/en.json
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review the only new commit is a base-sync merge (5132d5b); no PR-authored source changed, only conflict resolution.
- Merged
origin/mainand re-integrated its subagent-resume feature with the search gating —AiVaultVirtualRownow passes bothsubagentResumeandsearchHit,VaultSessionRowthreadssubagentResumeinto the expanded details, andAiVaultSessionVirtualListwraps the list inSubagentExpansionProvider. - Re-threaded the
searchHitprop through the updatedVaultSessionRowtest helper, keeping the expanded-evidence test alongside main's child-resume test. - Merged both sides' i18n keys in
en.json. - Verified on the merge:
pnpm tc:webpasses, the four focused test files pass (21 tests), and there are no conflict markers.
The subagent merge is safe for search rows: aiVaultSearchHitToSession sets subagentTranscriptCount: 0 and subagent: null, so SessionSubagentsSection returns null for hit-derived rows and an unverifiable/withheld search source can never reach a subagent resume affordance.
ℹ️ PR body still describes the old stacked base
GitHub reports this PR's base as main, but the body still states it targets session-search-pr3b-wiring (#20516) with "Do not merge this draft." If the retarget to main was intentional after #20516 landed, the dependency/rebase instructions and the draft warning should be dropped so reviewers do not act on stale guidance.
Technical details
# Stale base instructions in the PR body
## Affected sites
- PR #20580 body — "Dependency/rebase instructions: this incremental PR targets `session-search-pr3b-wiring` (#20516), base `9845bef...`. Keep this target until the user merges prerequisites and explicitly requests a rebase onto main." and "Do not merge this draft."
## Required outcome
- Either update the body to reflect the current `main` base and drop the do-not-merge warning, or confirm the retarget was not intended.
## Open questions for the human
- Was the base retargeted to `main` after the prerequisite stack landed?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
main's tip fails `typecheck` and `static analysis` on `NativeChatMessageList.windowing.test.tsx`: #20898 moved the growth/append suite into its own file and took the last use of `NativeChatMessage` with it, leaving the import. Every open PR reds both jobs through the merge ref, so this rides the first branch that has to merge main in.
…lyai#20580) * feat(session-search): add ranked history panel search and consent * test: wait for initial session indexing before refreshing results * fix(lint): drop the type import stablyai#20898 left behind in the windowing test main's tip fails `typecheck` and `static analysis` on `NativeChatMessageList.windowing.test.tsx`: stablyai#20898 moved the growth/append suite into its own file and took the last use of `NativeChatMessage` with it, leaving the import. Every open PR reds both jobs through the merge ref, so this rides the first branch that has to merge main in.

Agent Session History now searches indexed transcript content when a query is entered. Results retain host-local relevance order, show safely highlighted matching evidence, and reuse the existing session rows, resume/drag handling and context menus. Clearing the query restores the ordinary history view.
aiVaultSearchconsent. The disclosure explains local transcript indexing, full conversations, the 3,072-character tool-output cap, no content redaction, and authenticated paired search exposure. PR8 is not required.Validation:
ORCA_BACKGROUND_LAUNCH=1 pnpm tc:web9845bef63a6d0b80ec37af82b5b275287b8e17df, including React Doctor and checked-type rules.ORCA_BACKGROUND_LAUNCH=1, isolated profiles and synthetic transcripts. Full renderer screenshots were captured through CDP and inspected.CI follow-up: PR Checks run 34874189347 passed on
e61aa5924c5, including all eight unit shards, Linux Electron scenarios, typecheck, static analysis, both packaging jobs and aggregate verify. Corrected the initial-indexing race in the Electron test; 59 focused tests, two hidden Electron scenarios and changed-code quality pass. Reviewed the disabled-host retry suggestion and retained Try again so users can recover after enabling indexing on the selected computer.Remaining validation gaps: live SSH/paired-runtime/WSL/Windows transport, native window focus, and launching a real agent from a result were not exercised. Resume/drag eligibility and payloads were checked without starting an agent CLI.
Dependency/rebase instructions: this incremental PR targets
session-search-pr3b-wiring(#20516), base9845bef63a6d0b80ec37af82b5b275287b8e17df. Keep this target until the user merges prerequisites and explicitly requests a rebase onto main. CLI #20514 is an independent API consumer, not a dependency. Settings/status PR8 is independent. Windows numeric file-ID fix #20551 is already on main and deliberately not duplicated; no local overlay was needed for the macOS validation here. Pick it up on the later rebase. Do not merge this draft.Astra review:
gpt-6-astra, reasoning effortmedium, completed an initial review and rereview. Fixed all three findings: remove confirmed-deleted hits immediately; retain matching evidence when expanded; invalidate prior results/cursors on query/host transitions including an invalid-host roundtrip before debounce. Rereview found no further blocking issues and confirmed the extraction preserves ordinary behavior without unnecessary abstraction.Final follow-up review: a fresh
gpt-6-astrareview atmediumeffort examined the full incremental diff plus CI fix with the requested YAGNI, bug-risk and cognitive-load criteria. No blockers or further production changes recommended; confirmed disabled-host retry and the snapshot-aware test synchronization.Rendered evidence: consent, results, narrow dark layout, injected failure
Before enabling
Real indexed result
Narrow dark panel
Injected transport failure