Skip to content

fix(macos): stop reporting every app update as severed TCC attribution - #14655

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/fix-tcc-severed-false-positive
Aug 15, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/fix-tcc-severed-false-positive

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

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() in src/main/daemon/daemon-health.ts:

// removed
if (packagedAppVersion !== null && parsedPid.appVersion !== packagedAppVersion) {
  return 'severed'
}

Severed attribution is now reported only by the pre-existing spawner-path check from #12848. The now-unused packagedAppVersion parameter 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 recorded appVersion differed from the installed app version. Every routine update changes that string, so it fired on every update.

It has two consumers, and both misfired:

  1. useMacTccAttributionSeveredNotice.ts — an infinite toast telling the user to restart the daemon, which closes every running Orca terminal.
  2. daemon-init.ts:552-566 — automatic daemon replacement under reason severed_tcc_attribution when 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 +L NLINK=0, stat ENOENT), spawning process dead. Both of #12848's stated severance preconditions genuinely held. From a shell proven by ps -o ppid= to descend from daemon pid 4301:

Grant Probe (read-only, sends no input) Result
Automation / AppleEvents tell application "System Events" to count processes 82, exit 0
Accessibility (the exact -25211 symptom) get name of first window of process "Finder" Desktop, exit 0
Screen Recording CGPreflightScreenCaptureAccess() true

Errors were not being swallowed — a deliberately invalid query returned -1719, exit 1. TCC.db contains no AppleEvents grant for osascript, sh, zsh, login, Terminal, or iTerm, so com.stablyai.orca is the only object that could have authorized those calls. Attribution was intact.

Nothing is lost operationally. In daemon-init.ts the attribution check sits in the else of identity === 'mismatch' || stalePackagedBundle, where stalePackagedBundle is the same appVersion !== 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 no stale_bundle equivalent, 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), whose existsSync check 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: Infinity and offers to close all running terminals.
After: it appears only when the spawning binary path is genuinely gone.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

291 tests pass across the five touched suites on macOS:

daemon-tcc-attribution.test.ts, daemon-tcc-attribution-main-thread.test.ts,
daemon-health.test.ts                                    44 passed
daemon-init.test.ts, daemon-pty-adapter.test.ts         247 passed

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 bug
  • reports severed when the recorded spawning binary no longer exists — STA-3491 preserved
  • fails open without a recorded spawning binary / when no verifiable pid record exists — legacy pid files still return unknown, so no replacement is triggered
  • reports unknown off macOS

Plus a daemon-init.test.ts case proving version-mismatch replacement is billed to stale_bundle and 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

  • Security: none — removes a check, adds no new capability, touches no permission grant.
  • Cross-platform: macOS-only code path, already gated by process.platform !== 'darwin'.
  • Remote SSH / mobile: untouched.
  • Backwards compatibility: packagedAppVersion was internal to the main process; no wire format, IPC payload, or persisted schema changes. The pty.management.macTccAttribution IPC still returns the same { health } shape.
  • Performance: strictly less work — one fewer comparison and a smaller cache key.

Follow-up worth filing separately

The user TCC.db on the machine used for this investigation carries explicit deny records for com.stablyai.orca — kTCCServiceSystemPolicyAppBundles auth=0, kTCCServiceFileProviderDomain auth=0, kTCCServiceAppleEvents → com.openai.sky.CUAService auth=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 -25211 report than responsible-process severance — and one fixed by clearing the record with tccutil, not by replacing the daemon. Worth investigating before building more machinery on the severance theory.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Author

  • X / Twitter: @BrennanKB5

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.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c7f15a61-41e9-4d37-8169-884ab11f945b

📥 Commits

Reviewing files that changed from the base of the PR and between 0c4b57b and c420f73.

📒 Files selected for processing (6)
  • src/main/daemon/daemon-health.ts
  • src/main/daemon/daemon-init.test.ts
  • src/main/daemon/daemon-init.ts
  • src/main/daemon/daemon-pty-adapter.test.ts
  • src/main/daemon/daemon-pty-adapter.ts
  • src/main/daemon/daemon-tcc-attribution-main-thread.test.ts

📝 Walkthrough

Walkthrough

The macOS TCC attribution health API no longer accepts or caches packaged app versions. It uses spawnerExecPath to return intact or severed, with missing metadata returning unknown. Daemon health checks cache bundle inspections and retry failed verified reads. DaemonPtyAdapter replaces stale packaged daemons while preserving active or unverifiable sessions. Daemon initialization limits packaged versions to packaged macOS adapters and records non-daemon_died replacement reasons.

Merge Risk: ⚪ Minimal · up to c420f

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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the macOS TCC attribution bug fixed by the pull request.
Description check ✅ Passed The description is detailed and covers changes, rationale, testing, scope, and checklist items, but it does not provide the required linked issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

Comment @coderabbitai help to get the list of available commands.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron CDP validation — head c420f73cf4aa

Validated pushed PR 14655 at c420f73cf4aa9a51fd366e3f4f393938cfed372f on an isolated ORCA_DEV_USER_DATA_PATH + CDP 9336 instance. window.api.app.getIdentity() matched this worktree (brennanb2025/fix-tcc-severed-false-positive).

Action 1 — packaged version mismatch, real spawner path. Non-destructively set isolated daemon-v34.pid appVersion 1.4.178-rc.2 → 1.4.177 and kept the existing spawnerExecPath.
Result: pty.management.macTccAttribution returned { health: "intact" }. The infinite severed-attribution toast was absent, and Manage Sessions showed no remedy banner.

01-version-mismatch-intact-no-toast.png

Action 2 — missing spawner path. Non-destructively pointed only spawnerExecPath at /tmp/orca-pr14655-missing-spawner/Orca.
Result: health became severed. The Manage Sessions amber banner and infinite toast (macOS permissions may not reach Orca terminals) both appeared.

02-missing-spawner-severed-warning.png

Isolated PID record restored afterward; health returned to intact. No source edits, commits, or pushes.

@brennanb2025
brennanb2025 merged commit 1e80c77 into main Aug 15, 2026
50 checks passed
julien-herrera pushed a commit to Oxeegen/OxeeUI that referenced this pull request Aug 19, 2026
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)
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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.
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.

1 participant