fix(daemon): detect severed macOS TCC attribution behind terminal automation denials (STA-3491) (#12848)

* fix(daemon): detect severed macOS TCC attribution and surface daemon-restart remedy (STA-3491)

macOS pins the detached PTY daemon's TCC responsible process to the app
binary that forked it. Once that binary is deleted (packaged updates
replace the bundle), Accessibility/Automation grants on Orca silently
stop covering every daemon-hosted terminal: osascript/System Events
fails with -25211 no matter what the user grants.

- record spawnerExecPath in the daemon pid file at fork
- adoption checks it: severed + 0 live sessions -> replace the daemon
  (reason severed_tcc_attribution); live sessions are preserved
- Settings (Developer Permissions + Manage Sessions) show a visible
  banner pointing at Manage Sessions -> Restart while severed

* fix(daemon): harden TCC attribution recovery
This commit is contained in:
Brennan Benson
2026-08-05 23:54:30 -07:00
committed by GitHub
parent f82d5c3e6c
commit a2d438db17
25 changed files with 747 additions and 60 deletions
+2 -1
View File
@@ -8,7 +8,8 @@ export const DAEMON_REPLACE_REASONS = [
'unhealthy_resolver',
'stale_bundle',
'different_app_path',
'failed_health_check'
'failed_health_check',
'severed_tcc_attribution'
] as const
export type DaemonReplaceReason = (typeof DAEMON_REPLACE_REASONS)[number]
@@ -208,4 +208,3 @@ export function scheduleSharedControlReconnect(args: {
}
return { timer, reconnectAttempt: args.reconnectAttempt + 1 }
}