Skip to content

fix(mac): give the terminal host its own executable UUID so Local Network works in terminals - #42245

Merged
nwparker merged 1 commit into
mainfrom
nwparker/bug-local-network-access-breaks-after-every-orca
Nov 14, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/bug-local-network-access-breaks-after-every-orca

Conversation

@nwparker

@nwparker nwparker commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

On macOS, Orca's terminals run inside a small helper program that is a plain copy of Node.js. macOS's Local Network permission tells apps apart by a fingerprint baked into that program, and every copy of that Node version (nvm, Homebrew, other apps) has the same fingerprint. So macOS could mistake Orca's terminals for some other program and block LAN access even though Orca shows as allowed. This gives the helper its own fingerprint.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​23 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​22

What Changed

  • assembleMacTerminalHost rewrites the helper executable's Mach-O LC_UUID right after copying the pinned Node in, before signing. It reuses giveMacExecutableUniqueUuid from fix(mac): give Orca's main executable its own UUID so Local Network access works #41676: sha256(appId, "Orca Agents", cpuType), so it's unique to Orca and stable across releases.
  • verifyMacTerminalHost (every packaged build) and the post-notarization release check fail if the shipped helper lacks that UUID.
  • docs/agents-md-refs/macos-daemon-tcc-attribution.md: replaces the old note that called Node's shared UUID harmless.

Before: Orca Agents.app/Contents/MacOS/* = 6CAF9C5B-1E60-382D-B33C-06521A6AEB0F (official node-v24.22.1-darwin-arm64, checked against nodejs.org). After: 853646BB-8156-858A-85C1-7133D1ADB3FB (arm64).

Why

Since #27021, terminal processes' responsible process is the helper, launched by launchd. Apple TN3179: Local Network privacy uses the main executable UUID to map a process to an app and requires it to be unique. #41676 fixed this for Orca.app/Contents/MacOS/Orca and explicitly left the terminal host out of scope. Reporters' logs in #21988 and #38247 show the resulting split, e.g. found bundle id … by PID vs found bundle id <other> by UUID 6CAF9C5B…, allowed by preference while connections still return EHOSTUNREACH. Every terminal host build had the same UUID, so updating Orca didn't escape a poisoned mapping either.

Alternatives considered:

  • Share the main executable's UUID: might seem to help the post-update cache, but two different binaries with one UUID goes against TN3178 and is untested. It also turned out to be unnecessary (see Testing).
  • Separate bundle ID for the helper: would lose inherited Full Disk Access and folder grants (see the doc).
  • Restart daemons on update: kills live work.

Linked Issue

Fixes #21988

Related: #38247 (terminal-host half)

Visual Proof

N/A: no UI change. The packaging step changes 16 bytes in the helper executable.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Packaged build (electron-builder --mac dir --arm64, macOS 27.2): the helper UUID was rewritten, the existing check [verify-packaged-daemon-entry] OK — arm64 terminal host served a PTY passed, and so did [macos-terminal-host] OK.

Live Local Network experiment (macOS 27.2, arm64). A throwaway replica of Orca's layout, built by the repo's own UUID code and Developer ID-signed under a test bundle ID:

  • a main app on Node with its own UUID;
  • a nested … Agents.app helper, copied to daemon-host/terminal-host-<cdhash>/app.noindex/;
  • the helper launched by launchd with AssociatedBundleIdentifiers.

Each probe was a TCP connect to an on-link LAN host every 300 ms, from the helper and from a child process. The gateway is exempt from Local Network checks, so it isn't a valid target.

Scenario Helper's first LAN connection Failures
Fresh install, own UUID OK 0
Update (new build, app swapped in place, new copy path), own UUID → own UUID OK 0
Update, stock Node UUID → own UUID (the transition this PR ships) OK 0

Because the UUID is stable across releases, there's no re-match after updates.

Root cause, observed live: a second test app with stock Node as its main executable and Local Network denied logged found bundle id <test app> by PID but found bundle id com.stablyai.orca by UUID 6CAF9C5B-…. macOS attributes by the shared UUID to whichever bundle its cache maps it to. Reporters hit the reverse direction, with Orca's terminals attributed to the other claimant.

Unit: assembleMacTerminalHost now runs on a real Mach-O (/usr/bin/true) and asserts that the helper executable gets the derived UUID. Without the change this test fails.

Risk

Level: Low

  • The edit only touches the 16 UUID bytes before signing, the same mechanism fix(mac): give Orca's main executable its own UUID so Local Network access works #41676 already ships for the main executable. Signing, the designated requirement and TCC grants are unchanged. The PTY boot check guards it at build time.
  • Existing users' first update to this build changes the helper UUID once. The experiment above showed no failed connections for an allowed app.
  • Daemons that survive the update keep running the old binary until they are restarted (Settings → Terminal → Manage Sessions → Restart).
  • Crash reports from the helper no longer match stock Node symbols by UUID; Orca doesn't symbolicate Node anyway.
  • Back out with a plain revert. Afterwards, new helper builds return to the stock UUID.

…work access works in terminals

Orca terminals run under the signed helper, whose executable was stock Node,
sharing its LC_UUID with every install of that Node build. macOS Local Network
privacy maps a responsible process to an app by that UUID, so terminals could be
attributed to another program and blocked from the LAN while Orca showed allowed.

Rewrite the helper executable's UUID during assembly (same scheme as #41676),
and fail packaging and the release check if it drifts.

Fixes #21988
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The macOS terminal-host packaging flow now assigns a UUID derived from the app bundle identifier to its copied Node executable and checks that UUID during verification. Tests cover the UUID assignment and verification. Documentation describes the rewritten UUID and checks for UUID drift. The notarization overlap check now uses the executable path returned by macTerminalHostPaths.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 7314d

This change gives the macOS terminal helper its own executable UUID and checks it during packaging and release verification. No actionable merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: giving the macOS terminal host its own executable UUID so Local Network access works in terminals. The raw summary, the PR objectives, and the description all describe…
Description check Passed The description follows the template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #21988), Visual Proof (N/A with reason), Testing with checkboxes and detailed steps on packaged and li…
Linked Issues check Passed [#21988] The requirement is that Orca-launched child processes keep Local Network access after an Orca update without a manual permission toggle. The PR gives the terminal helper executable a stable, …
Out of Scope Changes check Passed All reviewed changes relate to the terminal host UUID objective of #21988. The changes are: (1) assembleMacTerminalHost UUID rewrite before signing; (2) UUID checks in verifyMacTerminalHost and the re…
Full details: Title check

Explanation

The title names the main change: giving the macOS terminal host its own executable UUID so Local Network access works in terminals. The raw summary, the PR objectives, and the description all describe this same change to the helper's Mach-O LC_UUID during assembly. The title is specific and matches the changeset. It is long at 92 characters, but it stays clear.

Full details: Description check

Explanation

The description follows the template closely. It has ELI5, What Changed, Why, Linked Issue (Fixes #21988), Visual Proof (N/A with reason), Testing with checkboxes and detailed steps on packaged and live experiments, and Risk with level and back-out plan. It explains before and after behavior, the mechanism, and alternatives considered. Gaps: the AI Disclosure section and the Agent skill upstream boundary checkbox are not filled in, and the Notes and Checklist sections are not addressed. The Review section is empty. The required AI Disclosure is conditional on team membership, so its absence is minor. The Agent skill upstream boundary checkbox is unchecked and should be ticked or explained. The Checklist is not marked. These gaps are non-critical, so the description is mostly complete.

Full details: Linked Issues check

Explanation

[#21988] The requirement is that Orca-launched child processes keep Local Network access after an Orca update without a manual permission toggle. The PR gives the terminal helper executable a stable, Orca-specific Mach-O LC_UUID. Terminal child processes, including Codex CLI, use this helper as their responsible process (per the PR description and #27021). At the reviewed head, config/scripts/macos/terminal-host-bundle/macos-terminal-host-bundle.cjs calls giveMacExecutableUniqueUuid(paths.executable, info.CFBundleIdentifier) in assembleMacTerminalHost, after copying the pinned Node and before signing. verifyMacTerminalHost calls assertMacExecutableUuid and adds any failure to the packaging problems. The UUID is derived from the app ID, so it does not change across releases. Limits: the repository evidence shows the code path, not runtime behavior. The live experiment results are author-reported and used a replica helper, not Codex CLI itself. The PR's first update from stock Node UUID to the Orca UUID changes the helper UUID once. Its reported outcome is no failed connections, but that outcome is not verified in the repository.

Full details: Out of Scope Changes check

Explanation

All reviewed changes relate to the terminal host UUID objective of #21988. The changes are: (1) assembleMacTerminalHost UUID rewrite before signing; (2) UUID checks in verifyMacTerminalHost and the release check through macTerminalHostPaths in config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs; (3) unit tests in macos-terminal-host-bundle.test.mjs covering the derived UUID; (4) the updated macos-daemon-tcc-attribution.md note explaining the change. The raw summary reports no unrelated source edits. The notarization script change only switches to the shared macTerminalHostPaths helper for the UUID check. The summary of the full PR diff does not show other unrelated files. Limit: I read only the assembly and verification part of macos-terminal-host-bundle.cjs, and the summary covers the remaining files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d28e7ea6-0b15-44a7-ba1d-9d8a0fa9d8c2
Commits

Reviewing files that changed from the base of the PR and between e784f98 and 7314d9a.

Files selected for processing: 4

  • config/scripts/desktop-distribution/macos/build-mac-notarization-overlap.mjs
  • config/scripts/macos/terminal-host-bundle/macos-terminal-host-bundle.cjs
  • config/scripts/macos/terminal-host-bundle/macos-terminal-host-bundle.test.mjs
  • docs/agents-md-refs/macos-daemon-tcc-attribution.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Local Network access breaks after every Orca update on macOS 27 until permission is toggled off/on

1 participant