Repository navigation
feat(ai-vault): name the host each search hit came from when hits span several hosts - #31261
Conversation
…n several hosts (#31139) An All hosts full-text search returned one flat list, and the same title or path often came up on two machines, so you could resume the wrong copy. When hits come from two or more hosts, each row now carries the same host chip the sidebar uses, labelled the way the host menu names that host. Hit order is unchanged; a single-host result shows no chip. Reported, with the proposed approach, by @quzard in #31139.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
When you search your agent history across All hosts, the same session title often shows up from two machines. Nothing told you which machine each result came from, so you could resume the wrong copy. Now each result names its machine with a small chip. This only happens when the results really come from more than one machine.
What Changed
devboxand the other on this Mac.Mechanism:
aiVaultSearchHitHostLabels(new,ai-vault-search-hit-hosts.ts) runs over the search's hit sessions inAiVaultPanel. It returns a host -> label map only when there are 2+ distinctexecutionHostIds, and takes labels from the panel's existinghostScopeOptions, falling back togetExecutionHostLabel.SessionMetadatarendersWorktreeHostContextBadge.title, plusmin-w-0 shrinkat this call site, so a long host name truncates in a narrow sidebar instead of pushing the row wider.aiVault.searchHitSourceHostin all six locales (en, es, fr, ja, ko, zh).Why
Linked Issue
Part of #31139 (item 3, "Telling search hits apart by host"). Reported, with this approach, by @quzard. The issue stays open: host-then-directory grouping, a shorter host menu and collapsed-by-default groups are deferred follow-ups.
Overlap: #23449 (open, external) names SSH hosts in search by their SSH target labels. All hosts search currently fans out to this computer and Orca servers only, so there's no conflict today. If SSH hosts join the search later, the SSH entries should take their labels from the store's SSH target names; this helper is the one place to change.
Visual Proof
These show real
AiVaultVirtualRowcomponents rendered inside a hidden Orca dev renderer (ORCA_BACKGROUND_LAUNCH=1, CDP screenshot). They were mounted with three search-hit sessions from three hosts, because pairing two real Orca servers just for a screenshot wasn't practical.Light:
Dark:
Before: the same rows without the
devbox/Local Mac/build-hostchips.Testing
ai-vault-search-hit-hosts.test.ts:AiVaultVirtualRow.test.tsx:Full static-analysis job run locally on this head. All steps passed except
check-e2e-typecheck-ratchetontests/e2e/helpers/phone-feed-list.ts. This PR doesn't touch that file, and the same step passed in CI on my other branches, so it appears to be specific to my local install.Unit tests in
src/renderer/src/components/right-sidebarand the sidebar badge users.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)