Repository navigation
feat(session-search): resolve Workspace and Project scope on the host - #21509
Conversation
The host must spell a project key exactly as the client does, so the two sides share one function instead of two copies that can drift.
The panel cannot keep translating a project into one path per worktree: a repo with 580 of them exceeds the 64-path cap and the search fails outright. The request now carries the scope's identity instead, and a host acknowledges the scope it resolved so a client can tell a scoped answer from an old host's unscoped one.
Every entry point already funnels into searchSessionService, so the identity becomes paths there once: native, WSL, SSH and relay hosts cannot disagree. A host that does not know the workspace or project answers scope-unknown rather than widening the search to everything it has.
Covers prior paths, a workspace another now claims, folder workspaces, a custom worktree base path, flat placement where the global root belongs to every project, and the 580-worktree fold the panel's path list could not do.
A full Repo/Project/ProjectHostSetup requirement forced test stores to stand up rows the catalog never looks at.
Workspace and Project name what to narrow to; All sends nothing. A host that answers a scoped search without acknowledging it is reported as needing an update, and none of its hits are shown, because they are not this scope's.
An old host strips the identity and answers with every session it has, and the answer is well-formed. The missing acknowledgement is the only evidence, so the merge drops those hits and names the host instead.
…ry entry point IPC, the runtime RPC method, the relay handler and the shared remote client each carry the identity out and the acknowledgement back, and the relay -- which has no repo catalog -- reports the scope rather than widening the search.
|
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:
📝 WalkthroughWalkthroughThe search contract now carries workspace or project identities instead of client-generated path lists. Hosts build execution-host-specific catalogs, resolve identities into folded paths, and pass resolved or unknown scope verdicts through IPC, RPC, relay, and child-service boundaries. Unknown scopes return a dedicated unavailable result. Renderer search state no longer tracks acknowledgement failures and now displays scope-unknown status text. Shared project-key construction is centralized. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Scoped searches can expose unrelated session results from an older host. This compatibility safeguard should be restored before merging. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 36.96% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 46 functions across 43 files. (1 skipped: 1 unsupported.) Full details: Description checkExplanation The description gives detailed bug, design, and testing context, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue with a Fixes reference, Visual Proof or N/A, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist confirmations. Resolution Complete the required template sections. Add a plain-language ELI5 summary, structured What Changed and Why sections, a Linked Issue using the required Fixes # format, Visual Proof or N/A with a reason, AI Disclosure, Review, Agent skill upstream boundary, Notes, and the applicable Checklist confirmations.
✨ 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 |
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: cc7be64d-92de-4d7d-a69f-7d356f01e58a
📒 Files selected for processing (29)
src/cli/agent-session-search-format.tssrc/main/ai-vault-search/session-search-enablement.tssrc/main/ai-vault-search/session-search-scope-catalog.tssrc/main/ai-vault-search/session-search-scope-entry-points.test.tssrc/main/ai-vault-search/session-search-scope-paths.tssrc/main/ai-vault-search/session-search-scope-resolution.test.tssrc/main/ai-vault-search/session-search-scope-resolution.tssrc/main/ai-vault-search/session-search-scope-service.test.tssrc/main/ai-vault-search/session-search-service-registry.tssrc/main/ai-vault-search/session-search-store-scope-catalog.test.tssrc/main/ai-vault-search/session-search-store-scope-catalog.tssrc/main/ipc/ai-vault-search-all-hosts.tssrc/main/startup/main-process-runtime-service.tssrc/renderer/src/components/right-sidebar/AiVaultPanel.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanelSearch.test.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsxsrc/renderer/src/components/right-sidebar/ai-vault-project-key.tssrc/renderer/src/components/right-sidebar/ai-vault-scope-paths.tssrc/renderer/src/components/right-sidebar/ai-vault-search-scope-identity.test.tsxsrc/renderer/src/components/right-sidebar/ai-vault-search-scope-identity.tssrc/renderer/src/components/right-sidebar/use-ai-vault-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/ai-vault-project-key.tssrc/shared/ai-vault-search-contract.tssrc/shared/ai-vault-search-scope-acknowledgement.tssrc/shared/ai-vault-search-scope-contract.test.tssrc/shared/ai-vault-search-scope.tssrc/shared/ai-vault-search-types.tstests/e2e/cross-version-wire/cross-version-session-search-scope.unit.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
The merge built its results without the acknowledgement, so the renderer read it as an old host, dropped every hit and asked for an update. That is the default path: the panel defaults to Workspace and the host scope falls back to All. Per-host skew is still reported through `hosts`. Host-resolved paths no longer travel in `filters.scopePaths`. That field is capped at 64 for the clients that write it by hand, and the scanner child re-parses the request with the same schema -- so a project whose worktrees do not share one managed directory failed at 65 paths with "not ready". They ride beside the request now, where no wire cap applies. Managed directories come from buildKnownOrcaWorkspaceLayouts, so a workspace root the user has since moved away from is covered too. A workspace identity is resolved through this host's own worktree registry rather than the directory embedded in the client-supplied id.
There was a problem hiding this comment.
Caution
All-computers searches scoped to a Workspace or Project are broken: the merge never acknowledges the scope, so the panel reports "This computer needs an Orca update" and shows no hits even when every host is current.
Reviewed changes — full diff through f864bbc (29 files, 8 commits).
- Scope identity on the request —
within: { kind:'workspace', worktreeId } | { kind:'project', projectKey }, with a.refinerefusing it alongsidefilters.scopePaths; neither still means every session.toAiVaultProjectKeymoved tosrc/sharedso client and host share one spelling. - Host-side resolver —
session-search-scope-resolution.tsturns the identity into paths once atsearchSessionService: a project is its checkout, its managed worktree directory, external registered worktrees, and prior paths of renamed worktrees, folded by prefix so nested worktrees collapse. The catalog is a host-filtered snapshot of the persisted store, never a git scan. - Acknowledgement & version skew —
resolvedWithin(kind + path count) on aresultsanswer; awithinrequest answered without it is read as an old host, andscope-unknownis a first-class answer instead of widening. - Panel wiring — the panel sends an identity instead of a path list, renders needs-update / scope-unknown copy, and lists per-host skip reasons in a merge.
- Tests — contract, resolver, all four entry points, panel hook, and a new-client-against-old-host skew test.
Both issues below are confirmed by static tracing; I have not executed a runtime reproduction.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues — the two prior findings are resolved by
38d705a. One question inline.
Reviewed changes — incremental against f864bbc (head now 38d705a, 41 files).
- All-computers merge acknowledges the scope —
searchAllExecutionHostspassesrequest.within !== undefinedintomergedSearchResponse, which setsresolvedWithin: true, so the renderer no longer reads a fully current merge as an old host. New tests pin both the acknowledged and the unacknowledged case, andresolvedWithinbecamez.literal(true). - Resolved paths leave the request —
hostScopePathsnow rides beside the request through the scanner-child protocol and is merged intofilters.scopePathsonly at the engine, so a flat or external project with more than 64 worktrees no longer trips the child's re-parse. A test asserts 101 paths survive and the request still re-parses. - Managed directories enumerate history —
managedWorktreeDirectoriesusesbuildKnownOrcaWorkspaceLayouts, coveringworkspaceDirHistoryand a configured base claimed as-is. - Workspace identity is verified against the host registry —
registeredWorktreeIdrefuses a client-named directory the host has not registered (except the repo checkout), which closes the arbitrary-path hole. - Panel copy —
scope-unknownhosts are listed only when no computer resolved the scope;needsUpdatemoved into the page state.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Host-resolved paths are a second argument now, so the call-shape assertions that pinned a one-argument call name it.
…cope The registry short-circuited an unresolvable scope before current.search ran, and current.search is where disabled and not-ready are decided. A host with indexing off that lacks the project told the user it did not have the workspace, which they cannot act on. The verdict now travels to the service beside the request, and the service answers it after its own checks.
An unknown verdict is still a verdict, and it was being acknowledged as if the host had narrowed. The skipped banner also counted only 'searched' as having resolved the scope, so a host that resolved it and came back stale or timed out let the scope lines reappear where they explain nothing.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Base resolvedWithin on a resolved host. · ai-vault-search-all-hosts.ts:280-283
src/main/ipc/ai-vault-search-all-hosts.ts:280-283
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winBase
resolvedWithinon a resolved host. When every leg returnsscope-unknownorneeds-update,fetchHostPageemits no hits, butmergedSearchResponsestill setsresolvedWithin: truefrom the request alone. The panel then treats the scoped search as acknowledged and does not setneedsUpdate. This produces an incorrect acknowledgement status. The existing filtering still prevents unscoped hits, so this does not widen results.Set the acknowledgement only when at least one host has outcome
searched.Suggested fix
+ const resolvedWithin = scoped && walks.some((walk) => walk.outcome === 'searched') return { kind: 'results', hits, @@ - ...(scoped ? { resolvedWithin: true as const } : {}), + ...(resolvedWithin ? { resolvedWithin: true as const } : {}),
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 444a8796-3503-442f-b537-b1ae89dacc53
📒 Files selected for processing (18)
src/main/ai-vault-search/session-search-child-service.test.tssrc/main/ai-vault-search/session-search-child-service.tssrc/main/ai-vault-search/session-search-in-process-service.tssrc/main/ai-vault-search/session-search-instance.test.tssrc/main/ai-vault-search/session-search-instance.tssrc/main/ai-vault-search/session-search-scope-entry-points.test.tssrc/main/ai-vault-search/session-search-scope-resolution.tssrc/main/ai-vault-search/session-search-scope-service.test.tssrc/main/ai-vault-search/session-search-service-registry.tssrc/main/ai-vault-search/session-search-service.tssrc/main/ai-vault/session-scanner-service-protocol.tssrc/main/ai-vault/session-scanner-service-search.tssrc/main/ai-vault/session-scanner-service-spawn.tssrc/main/runtime/rpc/methods/ai-vault-search.test.tssrc/relay/session-search-transport.test.tssrc/renderer/src/components/right-sidebar/AiVaultPanelSearch.test.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsxsrc/shared/ai-vault-search-test-fixture.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/main/ai-vault-search/session-search-child-service.ts
- src/main/ai-vault-search/session-search-in-process-service.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
ℹ️ No critical issues — minor suggestions inline.
Reviewed changes — incremental against 7467c46 (head now 61356d8, 44 files, 12 commits; the two commits pushed since the prior pullfrog review).
- Consent and readiness answer before an unknown scope — the registry hands its
{kind:'resolved'|'unknown'}verdict to the service instead of answeringscope-unknownitself, soSessionSearchInstance.searchreturnsdisabled/not-readyfirst and a switched-off host (the relay) no longer blames the scope. - Acknowledgement only for a resolved scope — the registry sets
resolvedWithinonly when the verdict isresolved, so a live host answeringscope-unknownis not acknowledged as scoped. - Panel treats a stale leg as having resolved the scope —
describeSkippedHostsnow computesanyResolvedas the complement ofUNSETTLED_SCOPE_OUTCOMESrather thanoutcome === 'searched'.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| const UNSETTLED_SCOPE_OUTCOMES = new Set<AiVaultSearchHostOutcome['outcome']>([ | ||
| 'scope-unknown', | ||
| 'needs-update', | ||
| 'unreachable' | ||
| ]) |
There was a problem hiding this comment.
disabled, not-ready, and no-service are treated as settled here, so a scope-unknown leg is dropped from the banner whenever any other leg is merely off or booting — even though that leg never applied the scope. The banner then reads as if the scope-unknown host was searched and found nothing, which contradicts the docstring's "got far enough to apply the scope" and the PR description's "scope-unknown is named ... only when no computer resolved the scope". If the broader behavior is intended, both should say so.
Technical details
# `disabled`/`not-ready`/`no-service` count as resolving the scope
## Affected sites
- `src/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsx:36-40` — `UNSETTLED_SCOPE_OUTCOMES` holds only `scope-unknown`/`needs-update`/`unreachable`; the complement (`searched`, `stale`, `disabled`, `not-ready`, `no-service`) counts as resolved.
- `src/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsx:50-54` — a `scope-unknown` leg is skipped whenever `anyResolved` is true.
- `src/main/ipc/ai-vault-search-all-hosts.ts:145-147` — a leg returning `{kind:'unavailable', reason}` ends as that reason, so `disabled`/`not-ready`/`no-service` are real per-host outcomes.
- `src/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsx:42-48` — docstring: "worth saying only when it explains an empty result ... when no computer resolved the scope".
## Required outcome
Decide whether an off or booting host counts as having resolved the scope. If it does not, `anyResolved` should be `searched || stale`. If it does, update the docstring and the PR description to state that any host named for its own reason also suppresses `scope-unknown`.
## Open questions for the human
- Under Project scope a user can scope across hosts where one is disabled and another simply lacks the project; suppressing the latter's line leaves the banner implying that host searched.No stable release ships search, so the only hosts that have it and predate `within` are dev and ad hoc builds. The acknowledgement, the needs-update outcome and the copy behind it would be permanent dead weight from the first stable release on. The scope-unknown outcome and the off / not-ready / unknown ordering stay. Also trims this PR's new docblocks to the repo's one-line why rule.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟠 Major · Restore the scoped-result acknowledgement contract. · ai-vault-search-contract.ts:79-113
src/shared/ai-vault-search-contract.ts:79-113
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftRestore the scoped-result acknowledgement contract.
When a reachable development or ad hoc host predates
within, it can ignore that field and return an ordinaryresultsresponse. The single-host path accepts those hits, and the all-host merger marks the host assearchedand includes its hits. No current response field lets callers identify or suppress those unscoped results.Restore
resolvedWithinand theneeds-updatehost outcome. Suppress unacknowledged results for single-host searches and exclude them from all-host merges. Restore regression tests for both paths.
🟡 Minor · Guard the no-matches message by host outcomes. · AiVaultPanelSearch.tsx:141
src/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsx:141
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winGuard the no-matches message by host outcomes.
When
response.hostscontains onlystale,scope-unknown, orunreachableentries, this condition still sets “No matching sessions”. The skipped-host logic then also renders “Not searched”, which gives conflicting status messages.Accept omitted
hostsfor single-host results. Whenhostsis present, require asearchedentry. Do not treathosts: []as evidence that a host searched.Proposed fix
- if (response?.kind === 'results' && search.hits.length === 0) { + if ( + response?.kind === 'results' && + search.hits.length === 0 && + (response.hosts === undefined || + response.hosts.some((entry) => entry.outcome === 'searched')) + ) {
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: c794825d-0941-49ac-bcfe-8193ec80b6c3
📒 Files selected for processing (18)
src/main/ai-vault-search/session-search-scope-catalog.tssrc/main/ai-vault-search/session-search-scope-entry-points.test.tssrc/main/ai-vault-search/session-search-scope-paths.tssrc/main/ai-vault-search/session-search-scope-resolution.tssrc/main/ai-vault-search/session-search-scope-service.test.tssrc/main/ai-vault-search/session-search-service-registry.tssrc/main/ai-vault-search/session-search-service.tssrc/main/ai-vault-search/session-search-store-scope-catalog.tssrc/renderer/src/components/right-sidebar/AiVaultPanelSearch.test.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanelSearch.tsxsrc/renderer/src/components/right-sidebar/ai-vault-search-scope-identity.test.tsxsrc/renderer/src/components/right-sidebar/ai-vault-search-scope-identity.tssrc/renderer/src/components/right-sidebar/use-ai-vault-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/ai-vault-project-key.tssrc/shared/ai-vault-search-contract.tssrc/shared/ai-vault-search-scope-contract.test.tssrc/shared/ai-vault-search-scope.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/main/ai-vault-search/session-search-service-registry.ts
- src/shared/ai-vault-project-key.ts
- src/renderer/src/i18n/locales/en.json
- src/main/ai-vault-search/session-search-store-scope-catalog.ts
- src/renderer/src/components/right-sidebar/ai-vault-search-scope-identity.ts
- src/main/ai-vault-search/session-search-service.ts
- src/main/ai-vault-search/session-search-scope-resolution.ts
- src/main/ai-vault-search/session-search-scope-paths.ts
- src/main/ai-vault-search/session-search-scope-catalog.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
There was a problem hiding this comment.
ℹ️ No new issues in this delta. Not approving only because an earlier minor panel-classification thread is still open on this PR.
Reviewed changes — incremental against 58819d4 (head now c786042, 41 files, 14 commits; the one commit pushed since the prior pullfrog review).
- Dropped the version-mismatch receipt —
resolvedWithin, theneeds-updateoutcome,isUnacknowledgedScopedSearch, the cross-version skew test, and the all-hosts merge acknowledgement are gone. Awithinrequest answered by a host that predates the field is no longer detected or suppressed; the commit's premise is that no stable release ships search, so only dev/ad hoc hosts can predate it. - Kept
scope-unknownand the ordering — the resolver verdict still rides beside the request, consent/readiness still answer before an unresolvable scope, and the panel still renders the scope-unknown copy plus per-host skip reasons. - Trimmed the new docblocks to the repo's one-line
whyrule across the scope modules.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
…#21509) * refactor(session-search): move the AI Vault project key to shared The host must spell a project key exactly as the client does, so the two sides share one function instead of two copies that can drift. * feat(session-search): add a scope identity to the search request The panel cannot keep translating a project into one path per worktree: a repo with 580 of them exceeds the 64-path cap and the search fails outright. The request now carries the scope's identity instead, and a host acknowledges the scope it resolved so a client can tell a scoped answer from an old host's unscoped one. * feat(session-search): resolve a scope identity on the host that answers Every entry point already funnels into searchSessionService, so the identity becomes paths there once: native, WSL, SSH and relay hosts cannot disagree. A host that does not know the workspace or project answers scope-unknown rather than widening the search to everything it has. * test(session-search): pin how a host resolves a scope identity Covers prior paths, a workspace another now claims, folder workspaces, a custom worktree base path, flat placement where the global root belongs to every project, and the 580-worktree fold the panel's path list could not do. * fix(session-search): type the scope store by what the catalog reads A full Repo/Project/ProjectHostSetup requirement forced test stores to stand up rows the catalog never looks at. * feat(session-search): send the scope identity from the panel Workspace and Project name what to narrow to; All sends nothing. A host that answers a scoped search without acknowledging it is reported as needing an update, and none of its hits are shown, because they are not this scope's. * test(session-search): pin the new-client-against-old-host skew An old host strips the identity and answers with every session it has, and the answer is well-formed. The missing acknowledgement is the only evidence, so the merge drops those hits and names the host instead. * test(session-search): pin the identity and acknowledgement across every entry point IPC, the runtime RPC method, the relay handler and the shared remote client each carry the identity out and the acknowledgement back, and the relay -- which has no repo catalog -- reports the scope rather than widening the search. * fix(session-search): acknowledge the scope on an all-computers merge The merge built its results without the acknowledgement, so the renderer read it as an old host, dropped every hit and asked for an update. That is the default path: the panel defaults to Workspace and the host scope falls back to All. Per-host skew is still reported through `hosts`. Host-resolved paths no longer travel in `filters.scopePaths`. That field is capped at 64 for the clients that write it by hand, and the scanner child re-parses the request with the same schema -- so a project whose worktrees do not share one managed directory failed at 65 paths with "not ready". They ride beside the request now, where no wire cap applies. Managed directories come from buildKnownOrcaWorkspaceLayouts, so a workspace root the user has since moved away from is covered too. A workspace identity is resolved through this host's own worktree registry rather than the directory embedded in the client-supplied id. * test(session-search): follow the service search signature Host-resolved paths are a second argument now, so the call-shape assertions that pinned a one-argument call name it. * fix(session-search): answer consent and readiness before an unknown scope The registry short-circuited an unresolvable scope before current.search ran, and current.search is where disabled and not-ready are decided. A host with indexing off that lacks the project told the user it did not have the workspace, which they cannot act on. The verdict now travels to the service beside the request, and the service answers it after its own checks. * fix(session-search): acknowledge only a scope that resolved An unknown verdict is still a verdict, and it was being acknowledged as if the host had narrowed. The skipped banner also counted only 'searched' as having resolved the scope, so a host that resolved it and came back stale or timed out let the scope lines reappear where they explain nothing. * refactor(session-search): drop the version-mismatch receipt No stable release ships search, so the only hosts that have it and predate `within` are dev and ad hoc builds. The acknowledgement, the needs-update outcome and the copy behind it would be permanent dead weight from the first stable release on. The scope-unknown outcome and the off / not-ready / unknown ordering stay. Also trims this PR's new docblocks to the repo's one-line why rule. (cherry picked from commit 73a58bd)

The bug
The Agent Session History panel's Project scope fails outright on any repo with more than 64 worktrees, showing "Could not search this computer. Check its connection and try again." The panel translated "this project" into one scope path per worktree and sent them as
filters.scopePaths;AiVaultSearchRequestSchemarefuses more thanAI_VAULT_SCOPE_PATHS_MAX_COUNT(64). The reporting user's repo has 580 worktrees.The design
The panel stops translating a scope into paths for search. It sends the scope's identity, and each execution host resolves that identity into its own paths.
within(scopethere already means the search tier). Two arms:{ kind: 'workspace', worktreeId }and{ kind: 'project', projectKey }, where the key is the samerepo:<repoId>/project:<projectId>string the panel already computes —toAiVaultProjectKeymoved tosrc/shared/ai-vault-project-key.tsso client and host share one spelling.filters.scopePathsstays as the explicit path filter the CLI's--pathuses. A request carrying both is refused; a request carrying neither still searches everything.searchSessionService, so the identity becomes paths there, once. A project on a host is its repo checkout, plus the directories Orca creates that repo's worktrees in — present and historical, from the samebuildKnownOrcaWorkspaceLayoutsenumeration worktree ownership uses — plus every registered worktree living outside them, plus the prior paths of renamed worktrees. Both the scanner and the index match by prefix, so the resolver folds any path contained in another: 580 worktrees under one managed directory collapse to that one directory.filters.scopePathsis a wire field capped at 64 for the clients that fill it in by hand, and the scanner child re-parses the request against that same schema, so a project whose worktrees do not share one managed directory would have been refused at 65 paths. A host's own answer about its own directories carries no cap.disabledornot-readyfor a scoped request exactly as for an unscoped one. Only a host that is on and ready answersunavailable / scope-unknown, and it never widens the search.AI_VAULT_SCOPE_PATHS_MAX_COUNTis untouched: it still bounds the CLI's--pathlist and the session list request.aiVault.listSessions,deriveAiVaultScopeSessionPathsand the mobile app are untouched.Supersedes
This supersedes #21496, the interim fix on
session-search-project-scopethat folded sibling paths on the client.Tests
scopePathsrefused, unknown arm refused, old shape still valid,scope-unknownon the response and as a per-host outcome.worktreeBasePath, a workspace root the user has moved away from, flat placement where the global root belongs to every project and 100 worktrees each become their own path, a directory the host has not registered, an unknown project, a project set up only on another host, and the 580-worktree fold.disabledand a starting onenot-readyfor a scoped request, and only an on-and-ready host answersscope-unknown.Gates:
pnpm tc,pnpm run check:code-quality:changed, the fourverify:localization-*scripts,react-doctor(no ref-mutation finding on the changed renderer files), and the Docker-backedtests/e2e/ssh-ai-vault-session-history.spec.tsall pass.