Files
orca/src/main/workspaces
Neilandggbdpq a2661f93ff fix(trust): remove only the Codex and agy workspace trust entries Orca created when a worktree is removed (#38969)
* fix(codex): remove Orca-created pre-trust entries when a worktree is removed

Records which [projects."<path>"] tables Orca's preflight trust created in a
managed Codex config (with the exact bytes written), and on worktree removal
deletes only those, inside the existing trust-config mutation queue. Removal
paths await the purge so a removal is never reported before the entry is gone.

Ported from #24803 (commits 88d5469c, c1ffc5a4, 11b0bd74, f85606b3) onto
current main: conflicts resolved, stray re-export wrappers dropped, and tests
trimmed to AGENTS.md rules (ordering/timing, private-state, Cartesian and
lower-layer duplicate cases removed).

Co-authored-by: Neil <neil@stably.ai>

* fix(antigravity): drop Orca-added trustedWorkspaces entries on worktree removal

Generalizes the Codex pre-trust ownership ledger into a small factory
(agent-trust-ownership-ledger.ts) and uses it for agy: when Orca appends a
worktree path to ~/.gemini/antigravity-cli/settings.json trustedWorkspaces, it
records the exact entry, and worktree removal removes only that recorded entry.
Entries that already existed before Orca's grant are never recorded or removed.

* fix(trust): keep folder-workspace trust on session removal; isolate trust test userData

Only checkout-deleting removal paths drop Orca-created agent trust now.
Folder-workspace sessions and forgotten orphans leave the directory on
disk, so removing one must not strip the grant siblings still rely on.
Also point the execution-host trust test at a temp userData so the new
ownership ledger never writes to the real Orca config, and make the e2e
removeWorktreeMetadataAndHistory stub return its Promise.

---------

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-06 03:32:02 -08:00
..