Skip to content

feat(session-search): add panel search and opt-in consent (PR7) - #20580

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

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

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​453 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​452
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​787 $\color{#cf222e}{\Huge{\mathbf{−}}}$​186 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​601

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.

  • One 250 ms debounced request uses the current all-content/indexed API defaults, existing agent/path/host filters, and bounded Load more pages. Query/host changes fence late responses; stale cursors restart page one once.
  • Inline Enable / Not now records the existing global aiVaultSearch consent. 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.
  • Disabled, not-ready, no-service, transport errors, empty results and limited results are explicit. All computers asks for one host; unavailable hosts never silently search local. Withheld/unverifiable source information gates source-dependent actions.
  • No backend/control-plane changes, status polling, mount-triggered index reconciliation, new endpoints, watchers, or two-stage query state.

Validation:

  • ORCA_BACKGROUND_LAUNCH=1 pnpm tc:web
  • 59 focused unit/integration tests: search debounce, cancellation and host/query fencing, pagination/stale cursors, safe highlighting/source adaptation, existing session-row behavior, existing list filters, confirmed deletion, and feat(ai-vault-search): construct the session search indexer in the scanner service behind a setting #20516 host/settings registration.
  • Changed-code quality passed against 9845bef63a6d0b80ec37af82b5b275287b8e17df, including React Doctor and checked-type rules.
  • English catalog generation, runtime catalog generation/check, localization extraction and coverage checks passed. Only new PR7 English entries are added; other locale gaps remain pre-existing.
  • Hidden Electron Playwright: real isolated synthetic Claude transcript → panel Enable → automatic indexing → Refresh → highlighted row. The test waits for indexing via read-only status before clicking Refresh: indexed queries are snapshots and may precede the first sweep. No test-side reconcile. Also checked empty query/results, context-menu availability, drag payload host ownership, expanded evidence, actual synthetic transcript deletion, and light/narrow-dark rendering. Separate injected IPC cases cover transport failure and disabled/not-ready/no-service; these are rendered contract checks, not remote E2E.
  • All apps/tests used 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), base 9845bef63a6d0b80ec37af82b5b275287b8e17df. 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 effort medium, 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-astra review at medium effort 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

consent.png

Real indexed result

results.png

Narrow dark panel

results-dark-narrow.png

Injected transport failure

failure.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 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:web plus the focused unit tests pass on this checkout.

Reviewed changes

  • Indexed panel search. useAiVaultPanelSearch/useAiVaultSearch debounce a single request per host/query/policy identity, fence late responses, restart page 1 once on a stale cursor, and page with loadMore; a non-empty query swaps the panel onto search.sessions and a single "Best matches" group.
  • Opt-in consent. AiVaultPanelSearch offers Enable/Not now only for a local, non-web scope with aiVaultSearch off, 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. aiVaultSearchHitToSession maps only host-provided fields; canResumeAiVaultSearchHit/hasAiVaultSearchHitPath gate resume, drag, copy-path, open/reveal log, open-cwd and delete so withheld/unverifiable sources cannot act, while history rows (searchHits undefined) 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. useAiVaultSessionDeleteAction gained onDeleted, 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.

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 test-only CI follow-up in e61aa592.

  • Stabilized the hidden-Electron search spec. tests/e2e/ai-vault-panel-search.spec.ts now waits for searchStatus('local').filesIndexed > 0 (30s poll) before clicking Refresh Session History, instead of racing the index sweep by asserting the highlighted row first. The refresh click routes to search.retry() while searching (AiVaultPanel.tsx onRefresh), so the assertion still fails if the retry/search path regresses. No production code changed.

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

@Jinwoo-H
Jinwoo-H force-pushed the session-search-panel-ui branch from e61aa59 to a59cd23 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: 969f5819-97df-4934-b5c1-62b4a17514d4

📥 Commits

Reviewing files that changed from the base of the PR and between 7532fd1 and 9acfcb2.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/NativeChatMessageList.windowing.test.tsx
  • src/renderer/src/i18n/locales/en.json
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/native-chat/NativeChatMessageList.windowing.test.tsx
🚧 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; 7 remain after this review.


📝 Walkthrough

Walkthrough

Adds 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 9acfc

No concrete merge-blocking issue remains in the supplied review evidence.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Issue #20551 is limited to the SQLite file-ID read fix and its regression coverage. This PR adds renderer search UI, consent handling, search hooks, pagination, highlighting, session-row behavior, loc… 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 #20551 …
Docstring Coverage ⚠️ Warning 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: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding session search and opt-in consent to the panel.
Description check ✅ Passed The description is detailed and covers the implementation, rationale, visual evidence, testing, validation results, known gaps, issue references, and review history. It does not reproduce every templa…
Linked Issues check ✅ Passed Issue #20551 requires REAL reads for dev and ino at both session-search read sites. It also requires regression coverage for unsafe IDs, partial or null identity pairs, unchanged-file decisions, a…
Full details: Out of Scope Changes check

Explanation

Issue #20551 is limited to the SQLite file-ID read fix and its regression coverage. This PR adds renderer search UI, consent handling, search hooks, pagination, highlighting, session-row behavior, localization, and end-to-end history-search tests. These changes implement a separate history-search feature. The linked issue provides no scope for these changes, and the summary provides no directly linked issue that expands #20551 to include them.

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 #20551 file-ID fix and its regression coverage.

Full details: Docstring Coverage

Explanation

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

# 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

@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

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/main and re-integrated its subagent-resume feature with the search gating — AiVaultVirtualRow now passes both subagentResume and searchHit, VaultSessionRow threads subagentResume into the expanded details, and AiVaultSessionVirtualList wraps the list in SubagentExpansionProvider.
  • Re-threaded the searchHit prop through the updated VaultSessionRow test 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:web passes, 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?

Pullfrog  | View workflow run | Using 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.
@Jinwoo-H
Jinwoo-H merged commit a7e34d5 into main Sep 16, 2026
34 checks passed
ivanvykopal pushed a commit to ivanvykopal/orca that referenced this pull request Sep 20, 2026
…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.
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