Skip to content

fix(ai-vault): bounded OpenClaw discovery; title filter when a host's search is off - #27089

Merged
OrcaWin merged 1 commit into
mainfrom
np/p395-ai-vault-scan-hygiene
Oct 10, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
np/p395-ai-vault-scan-hygiene

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​133 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​133
Prod 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​74 $\color{#cf222e}{\Huge{\mathbf{−}}}$​24 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​50

ELI5

Two Session History problems on remote computers:

  1. On an SSH host with OpenClaw, History walked every folder under each OpenClaw agent, including whole embedded Codex homes, before it could finish. On a busy host that was thousands of slow remote folder reads, and it also listed those Codex files as OpenClaw sessions.
  2. When you search History while looking at a remote computer whose full-text search is off, you got an empty list and a "Search is disabled" message, even for a plain title match. The remote index is not something this computer can turn on; relays keep theirs off by design.

What Changed

  • OpenClaw, before: the walk descended into every folder under <state>/agents and kept any .jsonl file under a folder named sessions, including <agent>/agent/codex-home/sessions/**.
  • OpenClaw, after: under each agent folder the walk enters only sessions (and everything inside it). Canonical sessions are still listed, including nested ones such as sessions/archive/*.jsonl. Embedded agent homes are never read.
  • Search, before: if one remote computer was in scope and it answered "search off" (or "no search service"), the list was replaced by a wall.
  • Search, after: the box goes back to the title filter for that computer, and a notice says "Full-text search is off on this computer, so only session titles are matched." Further typing filters titles locally and does not ask that computer again. "Not ready yet" still keeps full-text search, because it clears on its own.

Mechanism:

  • One openClawSessionDirectoryPredicate (depth 0: any agent folder; depth 1: only sessions; deeper: anything) is used by both the local source table and the SSH source table, through each walker's existing directoryPredicate hook. The OpenClaw source entry moves into openclaw-session-layout.ts beside that rule.
  • useAiVaultPanelSearch remembers that a single-host scope answered disabled or no-service and then reports searching: false plus titleOnly: true. AiVaultPanelSearch shows the notice.

Why

The depth rule follows the layout the reporter measured: 2,264 canonical session files next to 3,106 nested Codex files, and 14,990 directories. It keeps everything inside sessions/ recursive, as the report asked, so no canonical session is lost. For search, the response this computer already receives is enough evidence, so no new call or wire change is needed. The all scope is unchanged, because it already names each skipped computer.

Linked Issue

Fixes #11394
Fixes #22453

Visual Proof

N/A for screenshots. The visible change is one notice line above the title-filtered list when a remote computer's search is off. A component test covers it.

Testing

  • openclaw-session-layout.test.ts, new and failing on main: a real temp tree with main/sessions/canonical.jsonl, main/sessions/archive/older.jsonl and main/agent/codex-home/sessions/2026/rollout-x.jsonl.

    • The local walk lists only the two canonical files.
    • The SSH discovery path (discoverRemoteSourceCandidates with a recording filesystem) lists the same two and never reads a codex-home folder.
  • use-ai-vault-search.test.tsx, new and failing on main:

    • disabled and no-service fall back to the title filter and stop asking that host;
    • not-ready keeps full-text search.
  • AiVaultPanelSearch.test.tsx: the notice renders above the list.

  • Existing AI Vault scanner, delete-target, search-root and i18n suites pass. pnpm tc:node, pnpm tc:web, oxlint and check:code-quality:changed pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • SSH: fewer remote readDir round trips.
  • Wire: none. The search fallback reads the existing unavailable answer, so an old relay or server behaves the same.
  • Windows/WSL: the WSL OpenClaw roots use the same rule.
  • Translations are added for every shipped locale.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

… search is off

OpenClaw discovery walked every directory under <state>/agents and accepted
any JSONL under a 'sessions' segment, so an embedded <agent>/agent/codex-home
was walked (thousands of serialized SSH readDirs) and listed as OpenClaw.
Both the local and remote source tables now enter only 'sessions' below each
agent dir; the OpenClaw source entry moves next to that rule.

When a single host answers that its search is off (relays keep their index
off by design) or unavailable, the History box falls back to the title
filter for that host with a notice, instead of an empty wall.
@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 10, 2026 01:42
@coderabbitai

coderabbitai Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 23f19a6b-2a68-4f13-8042-9637f2353cd1

📥 Commits

Reviewing files that changed from the base of the PR and between d3e3b17 and 023a158.


📒 Files selected for processing (14)
  • src/main/ai-vault/openclaw-session-layout.test.ts
  • src/main/ai-vault/openclaw-session-layout.ts
  • src/main/ai-vault/remote-session-scanner-sources.ts
  • src/main/ai-vault/session-scanner-agent-sources.ts
  • src/renderer/src/components/right-sidebar/AiVaultPanelSearch.test.tsx
  • src/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsx
  • src/renderer/src/components/right-sidebar/use-ai-vault-search.test.tsx
  • src/renderer/src/components/right-sidebar/use-ai-vault-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@OrcaWin
OrcaWin merged commit d724de9 into main Oct 10, 2026
30 checks passed
@OrcaWin
OrcaWin deleted the np/p395-ai-vault-scan-hygiene branch October 10, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant