Repository navigation
fix(mac): give the terminal host its own executable UUID so Local Network works in terminals - #42245
Conversation
…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
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
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.
What Changed
assembleMacTerminalHostrewrites the helper executable's Mach-OLC_UUIDright after copying the pinned Node in, before signing. It reusesgiveMacExecutableUniqueUuidfrom 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(officialnode-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/Orcaand explicitly left the terminal host out of scope. Reporters' logs in #21988 and #38247 show the resulting split, e.g.found bundle id … by PIDvsfound bundle id <other> by UUID 6CAF9C5B…,allowed by preferencewhile connections still returnEHOSTUNREACH. Every terminal host build had the same UUID, so updating Orca didn't escape a poisoned mapping either.Alternatives considered:
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
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 PTYpassed, 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:
… Agents.apphelper, copied todaemon-host/terminal-host-<cdhash>/app.noindex/;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.
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 PIDbutfound 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:
assembleMacTerminalHostnow 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