Repository navigation
fix: avoid repeated macOS privacy prompts - #1524
Merged
nwparker merged 7 commits intoMay 7, 2026
Merged
Conversation
nwparker
commented
May 7, 2026
nwparker
left a comment
Contributor
Author
There was a problem hiding this comment.
Reviewed locally. No blocking findings. I specifically re-checked the root cause path for #1522, the new seeded auth-root cache behavior, local-vs-SSH path boundaries, the branch/head status polling replacement, terminal-history GC, and optional usage analytics. Focused Vitest coverage, oxlint, tc:node, and tc:web all pass locally.
….com-stablyai-orca-issues-1522 # Conflicts: # package.json # pnpm-lock.yaml
….com-stablyai-orca-issues-1522
buf0-bot Bot
pushed a commit
that referenced
this pull request
May 8, 2026
Don't seed empty-success worktree roots in worktrees:list[All] catch (prevents auth-cache poisoning); restored focus-gated fetchWorktrees polling for the active repo so non-active worktrees pick up terminal-driven branch switches; encode detached HEAD as undefined instead of '' so renderer's nullish-coalescing preserves prior branch. Rebased onto current main to apply only the intended diff.
nwparker
pushed a commit
that referenced
this pull request
May 8, 2026
Don't seed empty-success worktree roots in worktrees:list[All] catch (prevents auth-cache poisoning); restored focus-gated fetchWorktrees polling for the active repo so non-active worktrees pick up terminal-driven branch switches; encode detached HEAD as undefined instead of '' so renderer's nullish-coalescing preserves prior branch. Rebased onto current main to apply only the intended diff. Co-authored-by: orca-bot <[email protected]>
3 tasks done
AmethystLiang
added a commit
that referenced
this pull request
May 8, 2026
…cal alias (#1589) #1524 stopped realpath'ing every worktree root during background refreshes to avoid TCC prompts, which broke File Explorer for worktrees registered under /var/folders when realpath canonicalizes them to /private/var/folders. Lazily canonicalize the registered root only when the user actively touches it: pass the pre-realpath source path through resolveAuthorizedPath so isPathAllowedIncludingRegisteredWorktrees can match the canonical target against the source's registered ancestor and cache the canonical root for future lookups. Co-authored-by: Orca <[email protected]>
AmethystLiang
pushed a commit
that referenced
this pull request
May 10, 2026
The buf0-bot fix-PR #1572 (findings from #1524) re-added a 30s focus-gated fetchWorktrees poll in useGitStatusPolling that #1524 was specifically removing. The other two findings in #1572 (worktrees:list auth-cache poisoning and detached-HEAD encoding) are preserved. Why: parent PR #1524's intent was to reduce background polling; the bot's 'restoration' was an unintended behavior re-add framed as a bug fix. Co-authored-by: orca-bot <[email protected]>
6 tasks done
nwparker
added a commit
that referenced
this pull request
Aug 17, 2026
…uses fixed (#15018) * reland: portable startup-shell dialect, with the two revert causes fixed Relands #14863 (reverted by #14975) with fixes for both regressions the revert cited. 1. History GC deleted folder-workspace shell history. The live set was built from `getAllWorktreeMeta()` alone, but a folder workspace's PTY carries `folder:<id>` as its worktree id, so every live folder workspace looked orphaned. `getKnownWorktreeIdsForHistoryGc` now unions in `getFolderWorkspaces()`. Both consumers — the history-directory prune and the fish-history sweep — read that one set, so the fix covers bash, zsh and fish history alike. The directory prune had this gap since #1524; #14863 only widened its blast radius to fish files. 2. A copied Codex resume command aborted under `set -u`. Its leading clear statement has to test `$fish_pid`, and that unbound expansion takes the whole line — including the agent launch — down with it. Copied text runs in a shell Orca never spawned, so nothing can seed that variable first. The removal now rides on the agent itself as `env -u`, which needs no shell syntax and no expansion. Verified byte-identical under `set -u` in sh, bash, zsh, dash, ksh and fish. `env` cannot run the `cd` builtin, and a child `cd` would not move the agent, so the prefix is placed on the agent rather than on the whole `cd … && agent` chain. cmd and PowerShell have no nounset hazard and keep their clear ahead of the `cd`, which preserves `cd … && agent` — a failed `cd` still cannot launch the agent in the wrong directory. * fix(history-gc): stop three more paths from deleting live shell history Found by adversarial review of the reland. All three are the same class as the bug that caused the revert: a live set that is missing a category of real workspace, so the GC reads it as orphaned. 1. Profiles. The history root is `userData/terminal-history`, which has no profile segment, but the Store the GC consults is per-profile. So after a profile switch the live set condemned every other profile's history — and fish history, which lands in the user's own fish data dir, is shared by every profile on the machine. The live set now unions in the inactive profiles' worktrees and folder workspaces, read from their data files. A profile whose ids cannot be read reports the empty set rather than one that condemns real history. 2. No empty-set guard on the tree scan. `sweepOrphanedFishHistoryFiles` refuses an empty live set because it cannot be told apart from a store that failed to hydrate; the directory scan, which deletes more, had no such guard. A store that fell back to default state would have taken every worktree's bash and zsh history with it, across all roots including WSL. Four existing tests passed `new Set()` and relied on "empty means everything is orphaned" — exactly the behavior being removed — so they now pass a real live set. 3. Relay fish history. The relay isolates its history tree under its own root but wrote fish history into the shared fish data dir under the desktop naming, keyed by the CLIENT's worktree ids. On a machine running both Orca and a relay host, the desktop sweep deleted remote sessions' history once it went stale. Relay files are now `orca_relay_<hash>`, which the sweep's pattern deliberately does not match; the relay still deletes them by exact name when the worktree goes away. * fix(resume): enforce the env-removal invariants instead of documenting them Both found by adversarial review; both were unreachable from today's callers and silent if reached, which is exactly how they would survive to a caller that does reach them. - A pinned CODEX_HOME and the removal named the same variable, and `env -u` strips what the assignment just set — so the agent would have resumed against the real home and not found the session. The removal list now excludes any name the prefix pins, keeping the assignment authoritative as the old `clear…; CODEX_HOME=x agent` ordering did. Same fix in the git-bash twin. The PowerShell branch already clears before it assigns, so it was never affected. - Placement was keyed on the platform while the grammar it selects is keyed on the shell, so `platform: 'linux'` with `shell: 'powershell'` emitted POSIX `env -u` into a PowerShell line. PowerShell now routes to the PowerShell builder whatever the host, and the POSIX/cmd split below asks the shell rather than the platform.
paidaxingyo666
pushed a commit
to paidaxingyo666/Manta
that referenced
this pull request
Aug 21, 2026
…uses fixed (stablyai#15018) * reland: portable startup-shell dialect, with the two revert causes fixed Relands stablyai#14863 (reverted by stablyai#14975) with fixes for both regressions the revert cited. 1. History GC deleted folder-workspace shell history. The live set was built from `getAllWorktreeMeta()` alone, but a folder workspace's PTY carries `folder:<id>` as its worktree id, so every live folder workspace looked orphaned. `getKnownWorktreeIdsForHistoryGc` now unions in `getFolderWorkspaces()`. Both consumers — the history-directory prune and the fish-history sweep — read that one set, so the fix covers bash, zsh and fish history alike. The directory prune had this gap since stablyai#1524; stablyai#14863 only widened its blast radius to fish files. 2. A copied Codex resume command aborted under `set -u`. Its leading clear statement has to test `$fish_pid`, and that unbound expansion takes the whole line — including the agent launch — down with it. Copied text runs in a shell Orca never spawned, so nothing can seed that variable first. The removal now rides on the agent itself as `env -u`, which needs no shell syntax and no expansion. Verified byte-identical under `set -u` in sh, bash, zsh, dash, ksh and fish. `env` cannot run the `cd` builtin, and a child `cd` would not move the agent, so the prefix is placed on the agent rather than on the whole `cd … && agent` chain. cmd and PowerShell have no nounset hazard and keep their clear ahead of the `cd`, which preserves `cd … && agent` — a failed `cd` still cannot launch the agent in the wrong directory. * fix(history-gc): stop three more paths from deleting live shell history Found by adversarial review of the reland. All three are the same class as the bug that caused the revert: a live set that is missing a category of real workspace, so the GC reads it as orphaned. 1. Profiles. The history root is `userData/terminal-history`, which has no profile segment, but the Store the GC consults is per-profile. So after a profile switch the live set condemned every other profile's history — and fish history, which lands in the user's own fish data dir, is shared by every profile on the machine. The live set now unions in the inactive profiles' worktrees and folder workspaces, read from their data files. A profile whose ids cannot be read reports the empty set rather than one that condemns real history. 2. No empty-set guard on the tree scan. `sweepOrphanedFishHistoryFiles` refuses an empty live set because it cannot be told apart from a store that failed to hydrate; the directory scan, which deletes more, had no such guard. A store that fell back to default state would have taken every worktree's bash and zsh history with it, across all roots including WSL. Four existing tests passed `new Set()` and relied on "empty means everything is orphaned" — exactly the behavior being removed — so they now pass a real live set. 3. Relay fish history. The relay isolates its history tree under its own root but wrote fish history into the shared fish data dir under the desktop naming, keyed by the CLIENT's worktree ids. On a machine running both Orca and a relay host, the desktop sweep deleted remote sessions' history once it went stale. Relay files are now `orca_relay_<hash>`, which the sweep's pattern deliberately does not match; the relay still deletes them by exact name when the worktree goes away. * fix(resume): enforce the env-removal invariants instead of documenting them Both found by adversarial review; both were unreachable from today's callers and silent if reached, which is exactly how they would survive to a caller that does reach them. - A pinned CODEX_HOME and the removal named the same variable, and `env -u` strips what the assignment just set — so the agent would have resumed against the real home and not found the session. The removal list now excludes any name the prefix pins, keeping the assignment authoritative as the old `clear…; CODEX_HOME=x agent` ordering did. Same fix in the git-bash twin. The PowerShell branch already clears before it assigns, so it was never affected. - Placement was keyed on the platform while the grammar it selects is keyed on the shell, so `platform: 'linux'` with `shell: 'powershell'` emitted POSIX `env -u` into a PowerShell line. PowerShell now routes to the PowerShell builder whatever the host, and the POSIX/cmd split below asks the shell rather than the platform.
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
* fix: avoid repeated macos privacy prompts * fix: reduce background worktree permission probes * chore: pin oxlint for ci * fix: preserve optional rpc params with zod 4.4 * fix: preserve optional inline rpc params with zod 4.4
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
Don't seed empty-success worktree roots in worktrees:list[All] catch (prevents auth-cache poisoning); restored focus-gated fetchWorktrees polling for the active repo so non-active worktrees pick up terminal-driven branch switches; encode detached HEAD as undefined instead of '' so renderer's nullish-coalescing preserves prior branch. Rebased onto current main to apply only the intended diff. Co-authored-by: orca-bot <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…cal alias (stablyai#1589) stablyai#1524 stopped realpath'ing every worktree root during background refreshes to avoid TCC prompts, which broke File Explorer for worktrees registered under /var/folders when realpath canonicalizes them to /private/var/folders. Lazily canonicalize the registered root only when the user actively touches it: pass the pre-realpath source path through resolveAuthorizedPath so isPathAllowedIncludingRegisteredWorktrees can match the canonical target against the source's registered ancestor and cache the canonical root for future lookups. Co-authored-by: Orca <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…tablyai#1637) The buf0-bot fix-PR stablyai#1572 (findings from stablyai#1524) re-added a 30s focus-gated fetchWorktrees poll in useGitStatusPolling that stablyai#1524 was specifically removing. The other two findings in stablyai#1572 (worktrees:list auth-cache poisoning and detached-HEAD encoding) are preserved. Why: parent PR stablyai#1524's intent was to reduce background polling; the bot's 'restoration' was an unintended behavior re-add framed as a bug fix. Co-authored-by: orca-bot <[email protected]>
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…uses fixed (stablyai#15018) * reland: portable startup-shell dialect, with the two revert causes fixed Relands stablyai#14863 (reverted by stablyai#14975) with fixes for both regressions the revert cited. 1. History GC deleted folder-workspace shell history. The live set was built from `getAllWorktreeMeta()` alone, but a folder workspace's PTY carries `folder:<id>` as its worktree id, so every live folder workspace looked orphaned. `getKnownWorktreeIdsForHistoryGc` now unions in `getFolderWorkspaces()`. Both consumers — the history-directory prune and the fish-history sweep — read that one set, so the fix covers bash, zsh and fish history alike. The directory prune had this gap since stablyai#1524; stablyai#14863 only widened its blast radius to fish files. 2. A copied Codex resume command aborted under `set -u`. Its leading clear statement has to test `$fish_pid`, and that unbound expansion takes the whole line — including the agent launch — down with it. Copied text runs in a shell Orca never spawned, so nothing can seed that variable first. The removal now rides on the agent itself as `env -u`, which needs no shell syntax and no expansion. Verified byte-identical under `set -u` in sh, bash, zsh, dash, ksh and fish. `env` cannot run the `cd` builtin, and a child `cd` would not move the agent, so the prefix is placed on the agent rather than on the whole `cd … && agent` chain. cmd and PowerShell have no nounset hazard and keep their clear ahead of the `cd`, which preserves `cd … && agent` — a failed `cd` still cannot launch the agent in the wrong directory. * fix(history-gc): stop three more paths from deleting live shell history Found by adversarial review of the reland. All three are the same class as the bug that caused the revert: a live set that is missing a category of real workspace, so the GC reads it as orphaned. 1. Profiles. The history root is `userData/terminal-history`, which has no profile segment, but the Store the GC consults is per-profile. So after a profile switch the live set condemned every other profile's history — and fish history, which lands in the user's own fish data dir, is shared by every profile on the machine. The live set now unions in the inactive profiles' worktrees and folder workspaces, read from their data files. A profile whose ids cannot be read reports the empty set rather than one that condemns real history. 2. No empty-set guard on the tree scan. `sweepOrphanedFishHistoryFiles` refuses an empty live set because it cannot be told apart from a store that failed to hydrate; the directory scan, which deletes more, had no such guard. A store that fell back to default state would have taken every worktree's bash and zsh history with it, across all roots including WSL. Four existing tests passed `new Set()` and relied on "empty means everything is orphaned" — exactly the behavior being removed — so they now pass a real live set. 3. Relay fish history. The relay isolates its history tree under its own root but wrote fish history into the shared fish data dir under the desktop naming, keyed by the CLIENT's worktree ids. On a machine running both Orca and a relay host, the desktop sweep deleted remote sessions' history once it went stale. Relay files are now `orca_relay_<hash>`, which the sweep's pattern deliberately does not match; the relay still deletes them by exact name when the worktree goes away. * fix(resume): enforce the env-removal invariants instead of documenting them Both found by adversarial review; both were unreachable from today's callers and silent if reached, which is exactly how they would survive to a caller that does reach them. - A pinned CODEX_HOME and the removal named the same variable, and `env -u` strips what the assignment just set — so the agent would have resumed against the real home and not found the session. The removal list now excludes any name the prefix pins, keeping the assignment authoritative as the old `clear…; CODEX_HOME=x agent` ordering did. Same fix in the git-bash twin. The PowerShell branch already clears before it assigns, so it was never affected. - Placement was keyed on the platform while the grammar it selects is keyed on the shell, so `platform: 'linux'` with `shell: 'powershell'` emitted POSIX `env -u` into a PowerShell line. PowerShell now routes to the PowerShell builder whatever the host, and the POSIX/cmd split below asks the shell rather than the platform.
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.
Fixes #1522.
Summary
realpath()until a specific file operation needs canonicalization.fetchWorktreespoll by returning branch/head fromgit status --branchfor local and SSH paths.mainmerge’s oxlint 1.63 fallout by dropping the removedreact/jsx-uses-varsrule and replacing one existing error-boundarycomponentDidUpdatereset with derived state.Verification
pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/filesystem.test.ts src/main/ipc/worktrees.test.ts src/main/ipc/worktrees-windows.test.ts src/main/ipc/repos-create.test.ts src/main/ipc/repos-sparse-presets.test.ts src/main/ipc/repos-remote.test.ts src/main/git/status.test.ts src/relay/git-handler.test.ts src/renderer/src/store/slices/worktrees.test.ts src/main/window/attach-main-window-services.test.ts src/main/window/history-gc-worktree-ids.test.ts src/main/terminal-history.test.ts src/main/usage-worktree-metadata.test.ts src/main/claude-usage/store.test.ts src/main/codex-usage/store.test.ts src/main/claude-usage/scanner.test.ts src/main/codex-usage/scanner.test.tspnpm exec oxlint --format githubpnpm exec oxlint <touched files>pnpm run tc:nodepnpm run tc:web