Repository navigation
fix(macos): stop reporting every app update as severed TCC attribution - #14655
Conversation
getMacDaemonTccAttributionHealth returned 'severed' whenever the running daemon's recorded appVersion differed from the installed app version. Every routine update changes that string, so the check fired on every update and told users their macOS permissions no longer reached their terminals. Measured on a machine in exactly that state (daemon predating a ShipIt swap, version mismatch, spawning bundle unlinked with NLINK=0): Automation, Accessibility, and Screen Recording were all still allowed from a shell descended from that daemon, and TCC.db showed com.stablyai.orca as the only possible authorizer. Squirrel replaces the bundle at the same path and tccd tracks the responsible binary by file reference plus code identity, so a same-path update does not sever attribution. Drop the version compare and the packagedAppVersion plumbing it required. Genuine severing is still detected by the spawnerExecPath existence check from #12848. Stale-generation daemons are unaffected: daemon-init already replaces them at zero live sessions under reason 'stale_bundle'. Regression introduced in #13992, which validated the toast by hand-editing a pid record and never measured TCC behavior.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThe macOS TCC attribution health API no longer accepts or caches packaged app versions. It uses Merge Risk: ⚪ Minimal · up to This change removes a false macOS permission warning and its unintended terminal-replacement behavior; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
Electron CDP validation — head
|
stablyai#14655) Removes the appVersion!==packagedAppVersion check that returned 'severed' after every update, and re-expresses stale-daemon retirement under its own stale_bundle reason. Field-validated on a machine in the failing state: real ShipIt update cycle, both daemons still version-mismatched, no toast, 200 terminals preserved. (cherry picked from commit 1e80c77)
stablyai#14655) Removes the appVersion!==packagedAppVersion check that returned 'severed' after every update, and re-expresses stale-daemon retirement under its own stale_bundle reason. Field-validated on a machine in the failing state: real ShipIt update cycle, both daemons still version-mismatched, no toast, 200 terminals preserved.


ELI5
After every app update, Orca told you your macOS permissions had stopped reaching your terminals — and offered to fix it by killing every terminal you had open. That warning was wrong. Nothing was broken. This removes the bad check.
What Changed
Removed the app-version comparison from
getMacDaemonTccAttributionHealth()insrc/main/daemon/daemon-health.ts:Severed attribution is now reported only by the pre-existing spawner-path check from #12848. The now-unused
packagedAppVersionparameter is dropped from the function, its cache key,DaemonPtyAdapterOptions, and all five call sites.Why
The removed line returned
'severed'whenever the running daemon's recordedappVersiondiffered from the installed app version. Every routine update changes that string, so it fired on every update.It has two consumers, and both misfired:
useMacTccAttributionSeveredNotice.ts— an infinite toast telling the user to restart the daemon, which closes every running Orca terminal.daemon-init.ts:552-566— automatic daemon replacement under reasonsevered_tcc_attributionwhen live sessions hit zero.The premise behind it is false. The doc comment claimed that "once the spawning binary is deleted (every packaged update replaces the bundle) tccd can't resolve the grant subject." Squirrel/ShipIt replaces the bundle at the same path, and tccd tracks the responsible binary by file reference plus code identity — it survives unlink, move, and same-path replacement by an identically-signed bundle.
This was measured, not reasoned about, on a machine sitting in exactly the state the check calls broken — two daemons predating a ShipIt swap, both version-mismatched, spawning bundle fully unlinked (
lsof +LNLINK=0,statENOENT), spawning process dead. Both of #12848's stated severance preconditions genuinely held. From a shell proven byps -o ppid=to descend from daemon pid 4301:tell application "System Events" to count processes82, exit 0get name of first window of process "Finder"Desktop, exit 0CGPreflightScreenCaptureAccess()trueErrors were not being swallowed — a deliberately invalid query returned
-1719, exit 1.TCC.dbcontains no AppleEvents grant forosascript,sh,zsh,login,Terminal, oriTerm, socom.stablyai.orcais the only object that could have authorized those calls. Attribution was intact.Nothing is lost operationally. In
daemon-init.tsthe attribution check sits in theelseofidentity === 'mismatch' || stalePackagedBundle, wherestalePackagedBundleis the sameappVersion !== app.getVersion()comparison. Version-mismatched daemons are already replaced at zero live sessions under reason'stale_bundle', so on the adoption path the removed line was unreachable. All it added was the false warning.Known behavioural delta
DaemonPtyAdapter.replaceSeveredMacTccDaemonBeforeNewPty()gates only on'severed'and has nostale_bundleequivalent, so a version-mismatched daemon is no longer proactively replaced before a new PTY on that path. That is a code-freshness concern rather than a TCC one, and it was only ever happening as a side effect of a check that was wrong about permissions. Left out deliberately to keep this narrow — worth re-expressing as an explicit staleness check if that proactive replacement is actually wanted.Linked Issue
No issue — this is a regression found in dogfooding, introduced by #13992 (
e1ee1b3ef3, 2026-08-13) and never released. Related: #12848 (STA-3491), whoseexistsSynccheck this PR keeps.For the record, #13992 validated the toast by hand-editing a live daemon's pid record to
1.4.177"to simulate an update boundary" and confirming the toast appeared. No TCC behaviour was measured at any point, and the version compare exists to make that simulation trigger. #12848's severance mechanism was likewise a deduction — "the same resolution necessarily fails once that recorded binary is deleted" — asserted, never observed, in a PR that states the reporter's environment "is not reproducible here."Visual Proof
N/A — the observable change is the absence of a toast that should never have appeared. There is no new UI. The before/after is the warning in the screenshot below no longer firing after a routine update; the functional evidence is the probe table above.
Before: after any update, the "macOS permissions may not reach Orca terminals" toast appears with
duration: Infinityand offers to close all running terminals.After: it appears only when the spawning binary path is genuinely gone.
Testing
291 tests pass across the five touched suites on macOS:
New/updated coverage in
daemon-tcc-attribution.test.ts:reports intact after an app-version change when the spawning binary path still exists— the regression test for this bugreports severed when the recorded spawning binary no longer exists— STA-3491 preservedfails open without a recorded spawning binary/when no verifiable pid record exists— legacy pid files still returnunknown, so no replacement is triggeredreports unknown off macOSPlus a
daemon-init.test.tscase proving version-mismatch replacement is billed tostale_bundleand not to the TCC reason.Platforms: macOS only — the function returns
'unknown'off darwin and is unreachable elsewhere. No SSH, remote-wire, mobile, or Windows/Linux surface is touched.Review
process.platform !== 'darwin'.packagedAppVersionwas internal to the main process; no wire format, IPC payload, or persisted schema changes. Thepty.management.macTccAttributionIPC still returns the same{ health }shape.Follow-up worth filing separately
The user
TCC.dbon the machine used for this investigation carries explicit deny records forcom.stablyai.orca—kTCCServiceSystemPolicyAppBundlesauth=0,kTCCServiceFileProviderDomainauth=0,kTCCServiceAppleEvents → com.openai.sky.CUAServiceauth=0. A denied TCC record suppresses all future prompts and produces exactly "permanently denied regardless of the grants on Orca.app," which is a more parsimonious explanation for the original STA-3491-25211report than responsible-process severance — and one fixed by clearing the record withtccutil, not by replacing the daemon. Worth investigating before building more machinery on the severance theory.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Author