Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 9f7f5b399590f6a0df6c8ca7ff7e2ebc7393e4ba and 14881f265c3ef3e3b134472657c64a1f7e7ea404. 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe macOS privileged transaction applies Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The CLI registration path preserves the intended permissions and safely distinguishes recoverable stale symlinks from regular-file conflicts. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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.
✅ No new issues found.
Reviewed changes
- Publish the privileged symlink under
umask 022—buildMacPrivilegedSymlinkTransactionnow creates the macOS shim inside(umask 022; /bin/ln -s …), so the symlink inode is0755and survives the following/bin/ln -Phardlink into the command directory. The subshell keeps that umask out of the hardlink and rollback paths. - Pin the published mode in the transaction test — adds
expect((await lstat(fixture.commandPath)).mode & 0o777).toBe(0o755).
The fix targets the real cause: the transaction's own umask 077 (cli-command-filesystem-transaction.ts:188), not the caller's shell. The new assertion is genuine — the generated command sets umask 077 before creating the symlink, so a pre-fix run yields 0700 and fails on macOS. The non-privileged symlink() path is user-owned, so owner-read keeps readlink working there; no parallel gap.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 7e9a2143-2ae0-41bb-8c25-1c49fdbb2749
📥 Commits
Reviewing files that changed from the base of the PR and between 00dcd8c1e35500889783985a390f353d7b1d9c4c and c19cf03d5ee5af68cb6dcec3e4e8d02d751f8d0e.
📒 Files selected for processing (3)
src/main/cli/cli-command-filesystem-transaction.tssrc/main/cli/cli-command-inspection.tssrc/main/cli/cli-command-unreadable-symlink.test.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Recover from an unreadable managed symlink —
inspectSymlinknow catchesEACCES/EPERMfromreadlink/readFileand reports the entry asstale(currentTarget: null, "cannot be read — re-register" detail) instead of rethrowing, socli:getInstallStatusno longer crashes the Settings pane. - Stop treating a permission failure as instability —
inspectStableCommandno longer funnels a permission error into the "changed while Orca inspected it" retry loop; it returns the inspection with no target evidence so a privileged replace can still proceed. Non-permission errors still retry exactly as before. - New cross-platform test coverage —
cli-command-unreadable-symlink.test.tsinjects theEACCESonreadlinkand exercises bothgetStatusandinspectStableCommand. I ran it against the pre-fix source: both tests fail, reproducing the realEACCESthrow and the retry-to-failure error, so the coverage is not theatre.
The author-flagged trade-off — expectedRawSymlinkTarget is null for an entry that was unreadable to begin with, so the replace relies on device/inode identity — is bounded and reasonable. The alternative (failing the entire status call) is strictly worse, and the snapshot identity check still runs.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Scope the unreadable-entry recovery to confirmed symlinks —
inspectSymlinkrecordsconfirmedSymlinkfrom the successfullstatand now converts a permission error intostaleonly when the failing read was areadlinkon a confirmed symlink; an unreadable regular file re-propagates itsEACCESinstead of being offered for replacement. - Match that scoping in the stable-inspection loop —
inspectStableCommandderivesisSymlinkEntryfrom the post-inspection snapshot and swallows a permission error only on the symlinkreadlinkbranch; a permission error while hashing a regular file retries and fails exactly as before. - Cover both recovery paths in tests —
cli-command-unreadable-symlink.test.tsis restructured around amakeMacInstaller('symlink' | 'file')helper, adds the unreadable-regular-file rejection case, and is nowdescribe.skipIf(win32)so file-symlink creation does not break the Windows run. - Comment tightening —
9f7f5b3995rewords theWhycomments only; no behavioral effect.
The scoping is precise: both flags are only true after lstat confirms a symlink, and on that branch the only operation that can raise a permission error is readlink (no readFile follows it). I ran cli-command-unreadable-symlink.test.ts locally — 3/3 pass; the macOS-gated privileged-transaction suite skips on Linux as designed. This also resolves the two CodeRabbit threads from the prior revision.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
The macOS privileged symlink transaction created its link under whatever umask the installer inherited, so a restrictive umask left an `orca` shim other users cannot traverse. Pin the link to 022 in a subshell and assert the resulting mode in the privileged-transaction test.
Pinning the umask stops new installs from publishing an unreadable shim, but an install that already has one still crashes: macOS enforces a symlink's own mode on readlink(2), so the status call fails with EACCES before Settings can render and offer to re-register. Report such an entry as stale with no target evidence instead of rethrowing, and stop inspectStableCommand treating an unreadable entry as an unstable one — a permission error is returned rather than retried three times and thrown as "changed while Orca inspected it". Other errors retry as before. An unreadable target cannot be guarded by expectedRawSymlinkTarget either way, so the snapshot comparison remains the guard there.
Recovering every permission error in inspectSymlink also caught a regular file whose contents could not be read, and reported it as stale — so an unreadable file could be replaced instead of preserved as a conflict. Gate the recovery on lstat having confirmed a symlink, and suppress the error in inspectStableCommand only for that symlink read rather than the file-hash branch. Adds the regression test for the regular-file case, which reports stale without this gate, and skips these symlink fixtures on Windows, where creating a file symlink may need Developer Mode.
14881f2 to
60a2c09
Compare
Sync log entry for the rebase: 95 commits replayed, 87 byte-identical and 8 adapted by range-diff, none dropped, plus the two fix-up commits the gates forced; the four conflicting commits across eight files; and the two traps that fired with no conflict marker — three clean-merge renames only `pnpm tc` could see, and a computer-use test whose way of faking an unreadable plist stopped reaching the code when upstream moved the bundle-id read onto the shared spawn chokepoint. Also records the two deliberate divergences: the explorer hook converged onto upstream's request-key listing model, which folds our `totalCount`/`ignoredFiles` into it and drops our `resolvedQuery` fence and one upstream test whose premise #20 replaced; and the sidebar status filter re-seated into upstream's new `visible-worktree-options-from-state.ts`. BRANCHES.md takes the new base, the re-measured drift (436 and 530 commits behind), and notes that stablyai#20813 is open on a pre-sync base.
Sync log entry for the rebase: 95 commits replayed, 87 byte-identical and 8 adapted by range-diff, none dropped, plus the two fix-up commits the gates forced; the four conflicting commits across eight files; and the two traps that fired with no conflict marker — three clean-merge renames only `pnpm tc` could see, and a computer-use test whose way of faking an unreadable plist stopped reaching the code when upstream moved the bundle-id read onto the shared spawn chokepoint. Also records the two deliberate divergences: the explorer hook converged onto upstream's request-key listing model, which folds our `totalCount`/`ignoredFiles` into it and drops our `resolvedQuery` fence and one upstream test whose premise #20 replaced; and the sidebar status filter re-seated into upstream's new `visible-worktree-options-from-state.ts`. BRANCHES.md takes the new base, the re-measured drift (436 and 530 commits behind), and notes that stablyai#20813 is open on a pre-sync base.
Sync log entry for the rebase: 95 commits replayed, 87 byte-identical and 8 adapted by range-diff, none dropped, plus the two fix-up commits the gates forced; the four conflicting commits across eight files; and the two traps that fired with no conflict marker — three clean-merge renames only `pnpm tc` could see, and a computer-use test whose way of faking an unreadable plist stopped reaching the code when upstream moved the bundle-id read onto the shared spawn chokepoint. Also records the two deliberate divergences: the explorer hook converged onto upstream's request-key listing model, which folds our `totalCount`/`ignoredFiles` into it and drops our `resolvedQuery` fence and one upstream test whose premise #20 replaced; and the sidebar status filter re-seated into upstream's new `visible-worktree-options-from-state.ts`. BRANCHES.md takes the new base, the re-measured drift (436 and 530 commits behind), and notes that stablyai#20813 is open on a pre-sync base.
Sync log entry for the rebase: 95 commits replayed, 87 byte-identical and 8 adapted by range-diff, none dropped, plus the two fix-up commits the gates forced; the four conflicting commits across eight files; and the two traps that fired with no conflict marker — three clean-merge renames only `pnpm tc` could see, and a computer-use test whose way of faking an unreadable plist stopped reaching the code when upstream moved the bundle-id read onto the shared spawn chokepoint. Also records the two deliberate divergences: the explorer hook converged onto upstream's request-key listing model, which folds our `totalCount`/`ignoredFiles` into it and drops our `resolvedQuery` fence and one upstream test whose premise #20 replaced; and the sidebar status filter re-seated into upstream's new `visible-worktree-options-from-state.ts`. BRANCHES.md takes the new base, the re-measured drift (436 and 530 commits behind), and notes that stablyai#20813 is open on a pre-sync base.
Sync log entry for the rebase: 95 commits replayed, 87 byte-identical and 8 adapted by range-diff, none dropped, plus the two fix-up commits the gates forced; the four conflicting commits across eight files; and the two traps that fired with no conflict marker — three clean-merge renames only `pnpm tc` could see, and a computer-use test whose way of faking an unreadable plist stopped reaching the code when upstream moved the bundle-id read onto the shared spawn chokepoint. Also records the two deliberate divergences: the explorer hook converged onto upstream's request-key listing model, which folds our `totalCount`/`ignoredFiles` into it and drops our `resolvedQuery` fence and one upstream test whose premise #20 replaced; and the sidebar status filter re-seated into upstream's new `visible-worktree-options-from-state.ts`. BRANCHES.md takes the new base, the re-measured drift (436 and 530 commits behind), and notes that stablyai#20813 is open on a pre-sync base.
Sync log entry for the rebase: 95 commits replayed, 87 byte-identical and 8 adapted by range-diff, none dropped, plus the two fix-up commits the gates forced; the four conflicting commits across eight files; and the two traps that fired with no conflict marker — three clean-merge renames only `pnpm tc` could see, and a computer-use test whose way of faking an unreadable plist stopped reaching the code when upstream moved the bundle-id read onto the shared spawn chokepoint. Also records the two deliberate divergences: the explorer hook converged onto upstream's request-key listing model, which folds our `totalCount`/`ignoredFiles` into it and drops our `resolvedQuery` fence and one upstream test whose premise #20 replaced; and the sidebar status filter re-seated into upstream's new `visible-worktree-options-from-state.ts`. BRANCHES.md takes the new base, the re-measured drift (436 and 530 commits behind), and notes that stablyai#20813 is open on a pre-sync base.
|
Thanks @nplez1 for working on both the published link permissions and handling unreadable existing links, and for adding regression coverage. We've merged the team's fix for #19120 in #29245, which covers these cases. Closing this PR as superseded. We appreciate the investigation and testing you put into it. |
…c-log size Four pieces of process surface that disagreed with the tooling or with itself: - § "Syncing with upstream" ran `git rebase origin/main`, while the runbook and every sync actually recorded here merge `upstream/main` into the release line. Rebase is for a feature branch or the patch series, and the merge commits are load-bearing (rollback tags, one hand-resolved merge whose resolutions exist nowhere else). The section now says merge, and says why. - The pre-sync-tip diff wrote fixed `/tmp/modified.txt` and `/tmp/upstream-changed.txt`, and `local/open-pr.mjs` documented `--body-file /tmp/body.md`. That is exactly the collision two agents already had on a body file; both are `mktemp` now, and a test holds the fenced commands to it. - `.husky/commit-msg` said PR branches are cut from `origin/main`, contradicting AGENTS.md: fork PR branches are cut from `nplez1/main` and only upstream-bound ones from `origin/main`. - The sync log was ~1,980 lines of 26 entries, which is the size at which a section stops being read. The three most recent entries stay inline and the other 23 moved verbatim to `local/sync/sync-log-archive.md`, with a policy line rather than a habit: `tests/tools/fork-process-docs.test.mjs` fails if more than three are left inline. BRANCHES.md also records what the fixed `branch-status.mjs` now reports: the inventory is derived from the refs, PR state comes from both repos, and PR stablyai#20813 was closed upstream on 2026-10-16 rather than awaiting a human.
* fix(fork): derive the branch-status table from the refs it reports on `local/branch-status.mjs` is named in AGENTS.md and BRANCHES.md as the source of truth for branch state, and it was a hardcoded table its own header warns against: none of the live `nplez1/*` branches appeared, twelve of the fourteen listed ones existed nowhere, the default parent `origin/main` failed to resolve (origin's refspec maps only `refs/heads/nplez1/*`), so every "own delta" printed `0 file(s)`, `PARENTS['feat/terminal-session-reconnect']` never matched the branch that exists under `fix/`, and PR state was queried only on `stablyai/orca`. The inventory is now derived from `refs/heads/nplez1`, `origin/nplez1/*` and the fork's own heads (`git ls-remote --heads origin`, one call), so a branch that exists is reported and a deleted one cannot linger. The one named list left is the upstream-bound set, which no ref here describes, and a name in it that matches no ref is reported instead of ignored. The default parent is `nplez1/main`, a non-fork branch is measured against `upstream/main`, and a parent that does not resolve prints `parent <ref> MISSING` rather than a silent zero. PR state comes from the fork in one bulk query and from upstream per upstream-bound branch. `--local-only` keeps it usable offline, and the branch list, the parent keys and the two PR sources are covered by `tests/tools/branch-status.test.mjs`, including a real temp repo for the derivation and the delta. * feat(fork): validate an upstream PR against upstream, and enforce both PR gates Three defects in one file, all of them the same shape: a check that reported something other than what it read. `--upstream` targeted `stablyai/orca` but fetched and validated the base against `origin`, whose `main` is a different commit and whose refspec does not even map `refs/heads/main`, so the ref never resolved and `merge-base --is-ancestor` failed with "is not a descendant" — a wrong-remote bug diagnosed as a wrong-base one. The base is now resolved against the remote the PR targets, and an unresolvable base is reported as such. The naive repair is the hazard: `origin/main` *is* an ancestor of `nplez1/main`, so once the ref resolves any branch cut from the fork line would pass and carry all of the `local(...)` series upstream. An upstream head is now refused outright if its `base..head` range contains one. Both PR gates were advisory — recorded in AGENTS.md, read by nothing. Gate 1 now requires a cached unit-gate PASS for the exact head revision, and gate 2 a review claim line naming a round and a verdict. The verdict cache moved into `local/gate-verdict-cache.mjs` so `gate-unit.mjs` (which writes it) and this script (which reads it) cannot drift apart. `--waive-gate <1|2>:<reason>` records a deliberate exception and prints it for the PR body; an upstream PR skips gate 1, because upstream CI is the gate there. Covered by `tests/tools/open-pr.test.mjs`: the two targets and their remotes, the waiver parsing, the review-claim rules (including the markdown emphasis a body usually wraps it in), fork-only commit detection, and every gate-1 refusal path. * docs(fork): correct the release-line sync, the /tmp names and the sync-log size Four pieces of process surface that disagreed with the tooling or with itself: - § "Syncing with upstream" ran `git rebase origin/main`, while the runbook and every sync actually recorded here merge `upstream/main` into the release line. Rebase is for a feature branch or the patch series, and the merge commits are load-bearing (rollback tags, one hand-resolved merge whose resolutions exist nowhere else). The section now says merge, and says why. - The pre-sync-tip diff wrote fixed `/tmp/modified.txt` and `/tmp/upstream-changed.txt`, and `local/open-pr.mjs` documented `--body-file /tmp/body.md`. That is exactly the collision two agents already had on a body file; both are `mktemp` now, and a test holds the fenced commands to it. - `.husky/commit-msg` said PR branches are cut from `origin/main`, contradicting AGENTS.md: fork PR branches are cut from `nplez1/main` and only upstream-bound ones from `origin/main`. - The sync log was ~1,980 lines of 26 entries, which is the size at which a section stops being read. The three most recent entries stay inline and the other 23 moved verbatim to `local/sync/sync-log-archive.md`, with a policy line rather than a habit: `tests/tools/fork-process-docs.test.mjs` fails if more than three are left inline. BRANCHES.md also records what the fixed `branch-status.mjs` now reports: the inventory is derived from the refs, PR state comes from both repos, and PR stablyai#20813 was closed upstream on 2026-10-16 rather than awaiting a human.

ELI5
Registering the Orca CLI on macOS can publish
/usr/local/bin/orcaas a symlink only root may read. Running it still works, butreadlinkfails, and Orca usesreadlinkto report install status — so Settings → CLI registration crashes withEACCES. This publishes the link with a readable mode, and makes status survive a link that is already unreadable.What Changed
cli-command-filesystem-transaction.tscreates the published symlink as(umask 022; /bin/ln -s …), so it lands0755instead of inheriting the script'sumask 077. The subshell keeps077in force for the following/bin/ln -Pand the rollback paths.cli-command-inspection.tsreports an entry it cannot read asstalewithcurrentTarget: null, rather than rethrowing theEACCES. This applies only oncelstathas confirmed a symlink: a regular file Orca cannot read keeps failing, so it is never offered for replacement on evidence nobody inspected.inspectStableCommandreturns on a permission error from that symlink read instead of retrying three times and throwing "changed while Orca inspected it". Other errors, and permission errors while hashing a regular file, still retry exactly as before.0755;cli-command-unreadable-symlink.test.tscovers both recovery paths.Four files: two source, two tests.
Why
Fixes #19120.
macOS, unlike Linux, enforces a symlink's own permission bits on
readlink(2). The transaction runsln -sunder its ownumask 077, so the shim was published0700and root-owned. The link target was correct, which is why executing it worked while onlyreadlinkfailed — an asymmetry that surfaces as two unrelated-looking symptoms:EACCES: permission denied, readlink '/usr/local/bin/orca'.Unable to determine Orca.app path from symlink.Correcting creation alone is not enough for installs that already have the bad link. Inspection has to survive it before the user can reach the re-register action that applies the corrected mode.
Linked Issue
Fixes #19120
Visual Proof
N/A — no UI or interaction change. No
.tsxor renderer file is touched; the visible effect is that an existing crash stops.Testing
pnpm typecheckandpnpm buildpass (buildcoversbuild:cliand the native targets).Full
pnpm test: 81,234 passed, 0 failed. One file fails to load locally on untouchedmaintoo —tests/e2e/relay-region-correction.unit.test.tsneeds thecloud/workspace'spg, which CI installs.pnpm lint: this diff adds no findings, andoxlint --deny-warningsoversrc/and over the changed files exits 0. The full lint still fails on two pre-existingmobile/src/transportcycle warnings in files this branch does not touch.Manual, on installed builds (
ls -l /usr/local/bin/orca):lrwx------on a build registered 2026-09-12,lrwxr-xr-xon a build carrying this fix. Both hosts report a shellumaskof022, so the restrictive umask came from the transaction rather than the shell.cli-command-unreadable-symlink.test.tsinjects theEACCES, because the real case needs a root-owned0700link that a non-root test cannot create. Reverting either source change makes it fail with the matching symptom, which is how I found that the retry path needed its own fix.Surrounding suites also run:
src/main/cli(29 files, 212 tests),src/main/ipc/cli.test.ts,cli-appimage-stale-registration.test.ts, bothCliSectionsuites.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
AI-assisted: GPT-5.6 Luna and DeepSeek v4.1 Flash.
Review
AI code review summary, as CONTRIBUTING requests:
buildMacPrivilegedSymlinkTransaction); no Windows or Linux path, separator, or shortcut is affected.umaskbuiltin and one branch; no new I/O.077. No new privilege, input, or read. The one weakened guard is in Notes.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
inspectStableCommandreturnsrawSymlinkTarget: nullfor an unreadable symlink, and that value feeds the transaction'sexpectedRawSymlinkTargetcheck, so a replace proceeds without that guard — it cannot be captured for a target that cannot be read. The snapshot comparison (device, inode, mode, size, ctime) still runs, so a swap between inspection and replacement still aborts. Without this change the whole status call fails and the user can neither see nor repair anything.staleencourages re-registration, which displaces an existing entry. If that entry were a foreign root-owned link at this path, the transaction quarantines it and reports where the original is preserved.readlinkdoes not fail there; Windows uses a different install path.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)