Repository navigation
fix(terminal): re-verify cached macOS login-preflight rejections - #9973
Merged
brennanb2025 merged 8 commits intoJul 24, 2026
Merged
brennanb2025 merged 8 commits into
brennanb2025 merged 8 commits into
Conversation
Contributor
📝 WalkthroughWalkthroughThe daemon protocol version is increased to 27, with version 26 added to the previous-version compatibility list and corresponding tests updated. The macOS TCC login-shell provider now caches accepted PAM verdicts for the process lifetime while expiring rejected verdicts after a configured interval. PTY confirmation, concurrent probe deduplication, session health checks, and revalidation behavior are covered by tests. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
A conclusive PAM rejection was cached for the process lifetime, so one false verdict (the probe runs over pipes, not a PTY) disabled the login(1) TCC attribution wrapper for a daemon that survives app quits and updates for weeks — reintroducing the every-invocation AppData prompts #7003 fixed. Rejections now re-verify after 30 minutes; accepted verdicts still cache for the process lifetime. Refs #9756
Protocol 26 shipped the process-lifetime PAM rejection cache. Preserve its live sessions as a legacy generation, but route fresh terminals through protocol 27 so updating actually loads the expiring-cache fix. Refs #9756
brennanb2025
force-pushed
the
brennanb2025/bug-macos-access-other-apps-data-prompt-keeps-re
branch
from
July 22, 2026 21:34
38c6405 to
e38fae9
Compare
6 of 7 tasks
…s-access-other-apps-data-prompt-keeps-re
…s-access-other-apps-data-prompt-keeps-re
…s-access-other-apps-data-prompt-keeps-re
…s-access-other-apps-data-prompt-keeps-re
…s-access-other-apps-data-prompt-keeps-re Both sides bumped the daemon protocol to 27 (main: completion-process inspection #9263; this PR: preflight-cache replacement). Resolve by moving this PR's replacement bump to 28 so main-built v27 daemons, which lack the preflight fix, are also retired; completion inspection stays gated at >=27 and v27 joins PREVIOUS_DAEMON_PROTOCOL_VERSIONS.
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…blyai#9973) * fix(terminal): re-verify cached macOS login-preflight rejections A conclusive PAM rejection was cached for the process lifetime, so one false verdict (the probe runs over pipes, not a PTY) disabled the login(1) TCC attribution wrapper for a daemon that survives app quits and updates for weeks — reintroducing the every-invocation AppData prompts stablyai#7003 fixed. Rejections now re-verify after 30 minutes; accepted verdicts still cache for the process lifetime. Refs stablyai#9756 * fix(daemon): replace hosts with stale login preflight cache Protocol 26 shipped the process-lifetime PAM rejection cache. Preserve its live sessions as a legacy generation, but route fresh terminals through protocol 27 so updating actually loads the expiring-cache fix. Refs stablyai#9756 * fix(terminal): validate rejected login probes under a PTY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Protocol-26 PTY hosts could cache one macOS
login(1)PAM rejection for the lifetime of a daemon that survives app quits and updates. That silently disabled the TCC attribution wrapper for every later terminal and agent spawned by the daemon; children then collapsed intocom.stablyai.orca, and AppData grants could fail to persist (#9756, cause 2).The original pipe probe also had a fidelity gap: a tty-sensitive PAM stack can reject over pipes while the production
login(1)launch succeeds under a real PTY. Retrying only the pipe probe would not recover a deterministic mismatch.ELI5: Before and after
Think of the Orca background terminal host as a doorman checking whether macOS will let it label each command correctly.
Before
A check could incorrectly say “no” because it ran through a pipe instead of a real terminal. The doorman remembered that answer for as long as the background process lived—even through Orca quits and updates. New terminal tools could then be labeled as Orca, so clicking Allow might not stick and the same “access other apps’ data” prompt could return.
After
If the pipe says “no,” Orca double-checks using a real terminal—the same shape used to launch commands. A false “no” is corrected immediately; a real “no” is tried again later instead of remembered forever. Updating also moves fresh terminals to a new fixed background host.
What users should notice
After updating and opening a fresh terminal, repeated prompts caused by this stale check should stop. Existing old terminals can remain on the legacy host, and prompts caused by changing CLI identities or macOS session-only permissions are separate and may still appear.
Fix
expect-owned real-PTY oracle. A conclusive PTY acceptance enables the attribution wrapper immediately; an inconclusive confirmation preserves the safe direct-shell fallback.Scope
This fixes the stale/low-fidelity preflight failure mode identified as cause 2 in #9756. It does not claim to eliminate prompts caused by changing CLI code identities, macOS session-scoped grants for platform binaries, or local build/signing identity churn. The PR intentionally uses
Refs #9756, notFixes #9756.Reliability contract
terminal.macos-login-attribution): a fresh local or remote-macOS PTY uses thelogin(1)attribution wrapper whenever the production-shaped PTY oracle accepts it; rejected or inconclusive hosts still reach a usable direct shell. Updating cannot leave fresh sessions on a protocol-26 daemon with the permanent cache.config/reliability-gates.jsoncentry yet; that remains an accepted manifest gap for this narrow macOS host behavior.macos-login-preflightdaemon records and login-session-watch breadcrumbs retain outcome/reason without logging PAM output.Performance
Tests
pnpm run typecheck:nodepassed.oxfmtandoxlintpassed.verifyand packaged crash-survival both stopped at the same repository-wide TypeScript errors in untouchedworktree-common-git-directory.tsandskill-installation-topology.ts; contemporaneous PRs fail at the identical lines.No UI changes; screenshots are not applicable.
AI Review Report
The deeper review found and fixed three material issues:
mainadded a login-session health watcher that wrote rejected cache state without this PR's timestamp, recreating a permanent rejection after merge. All conclusive writers now share the cache transition.The final review covered startup warmup, local and daemon spawn boundaries, daemon upgrade routing, cache races/epochs, health-watch retirement authority, SSH/remote host locality, cancellation, subprocess/output bounds, and stable-negative cadence.
Security audit
The PTY confirmation reuses fixed absolute macOS system binaries, passes the OS-resolved username through an environment variable without shell interpolation, caps lifetime and output, closes stdin, and never logs captured PAM output. No credentials, dependencies, IPC schemas, persisted settings, or user-controlled commands are added. An unavailable or inconclusive oracle fails safe to the established direct-shell path.
Refs #9756