Repository navigation
fix(ai-vault): delete a server-hosted session on the server that owns it - #33906
Merged
Merged
Conversation
Agent Session History now routes Delete for a session on a paired or SSH-managed Orca server to that server through a new aiVault.deleteSession RPC. The host revalidates the path against its own roots, removes the transcript (into Trash on a desktop host; permanently on a plain-Node host, which has none), and invalidates its caches. Hosts advertise aiVault.delete-session.v1; an older host keeps Delete disabled with "Update <host> to delete its sessions from here." Co-authored-by: brynnclaw <261708852+brynnclaw@users.noreply.github.com>
Contributor
|
Warning Review limit reachedYou'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 2 minutes. View limit details
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 |
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Agent Session History could only delete sessions stored on this computer. A session on a paired Orca server, or on an SSH host that Orca now runs a managed server on, always said "Only sessions on this device can be deleted." Now Delete asks the machine that owns the session to delete it.
What Changed
aiVault.deleteSession, advertised asaiVault.delete-session.v1. The host ignores any host id the client sends and deletes only its own files. It runs the same checks as a local delete against its own roots: known roots, scanner-discoverable paths, symlink and realpath containment, and WSL. Then it invalidates its list, parse and background caches.files.delete).aiVault:deleteSessionfor aruntime:row to the owning server. Each row listed from a server is stamped with this desktop's pairing revision when it is scanned. The delete is fenced to that pairing, or to a same-host rotation of it, so if the same id is later re-paired to a different machine, that machine never receives the path. On success the main process invalidates its multi-host cache, which also stops scans already in flight from caching the deleted row again.Why
Since the managed-orcad migration (#27214), SSH hosts and paired servers are both
runtime:hosts. One owner-routed RPC therefore covers every remote session. Proxying a rawfiles.deleteinstead would skip the delete-target validation, so the host has to run the same validator it runs for local deletes.Thanks to @brynnclaw (#25169): that PR named the remote host by its user-facing label in the blocked-delete reason. This PR uses the same label (
selectExecutionHostDisplayLabel) in the confirmation and in the "update the host" reason. Credited as co-author.Linked Issue
Fixes #23556
Fixes #13471
Visual Proof
The change is copy in an existing confirmation dialog and tooltip, plus Delete becoming enabled on remote rows. No layout or styling change. Screenshots weren't captured: a paired server is needed to render a remote row.
Testing
src/main/runtime/rpc/methods/ai-vault-delete-session.test.ts(new) runs a real filesystem delete through the RPC dispatcher. The host deletes a transcript under its own roots even when the client sends another host id, refuses a path outside its roots and leaves it on disk, and advertises the capability. All three tests fail on main.src/main/ipc/ai-vault.test.ts:runtime:row is routed to its owning host, this computer never touches the path, and the multi-host cache is invalidated;src/main/ai-vault/runtime-session-scanner.test.ts:src/renderer/src/components/right-sidebar/ai-vault-session-deletability.test.ts: a server row offers Delete, an old server says "Update ", and synthetic and unroutable rows stay blocked.src/renderer/src/components/right-sidebar/ai-vault-session-delete-action.test.tsx(new): a mounted row re-enables Delete when its host is updated in place.runtime-session-scanner.test.ts: server rows carry this desktop's pairing stamp, not a value the host supplies.Ran every test file that imports a changed module (26 files). All pass except
AiVaultPanel.legacy-filter.test.tsx, which times out the same way on the unchanged base on this machine,pnpm tc,pnpm lint, the oxfmt check, the type-aware oxlint baseline,check:code-quality:changed, andcheck:runtime-electron-ratchet(the runtime still imports nothing from Electron).Not run: the Docker managed-orcad e2e lane, and a manual delete against a live paired server.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
method_not_found, which shows "Update ". An old client never calls the RPC.expectedEnvironmentPairingRevisionis an optional IPC-only field and isn't sent to the host.tryDeleteWslUncPath. Windows, macOS and Linux hosts use the same code path.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)