Skip to content

fix(macos): explain the TCC prompts, and surface Full Disk Access only to users macOS is prompting (#9756) - #9910

Merged
brennanb2025 merged 30 commits into
mainfrom
orca-trust-dialog
Jul 28, 2026
Merged

brennanb2025 merged 30 commits into
mainfrom
orca-trust-dialog

Conversation

@nwparker

@nwparker nwparker commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

macOS repeatedly shows "Orca" wants to access other apps' data (kTCCServiceSystemPolicyAppData), and for some users it keeps coming back after Allow (#9756).

The dialog names Orca, but Orca is rarely the thing reading anything. Agents and terminal commands do the access; TCC walks the responsibility chain back to the app that spawned the shell and puts Orca's name on the prompt. That mismatch is why the prompts feel inexplicable, and why "Allow" doesn't always stick — the grant is keyed to the accessing binary's identity, which churns every time an agent CLI updates.

This PR does two things: it explains that correctly where users already look, and it surfaces the Full Disk Access remedy only to users macOS is actually prompting.

What changed

1. The settings row now explains the real cause. Settings → macOS Permissions → Full Disk Access previously read "Recommended when projects, worktrees, or symlinked files touch macOS-protected folders" — which describes the rare case as the cause and never mentions the helper. It now attributes the prompts to the agents Orca runs, explains the responsible-process naming, and says the grant needs Orca Helper too plus a restart, because the preserved PTY daemon keeps stale TCC state.

2. A threshold-gated notice. tccd emits exactly one AUTHREQ_PROMPTING line per consent dialog it displays. A narrow log stream predicate watches for those, counts the ones where Orca is the responsible process, persists the count across launches, and shows a single toast on the third. The toast deep-links to the settings row and can be permanently dismissed.

The notice stays user-facing: it explains that macOS credits file access by agents and terminal tools to Orca, then points to Full Disk Access as the way to reduce repeated prompts.

3. No always-on nudge. An earlier revision of this PR added a permanent sidebar card for every macOS user without FDA. That's removed. Orca already had four ways to reach the FDA setting — the settings row (searchable), the Setup Guide pane, the Setup Guide modal, and the sidebar's own "Onboarding checklist" entry that opens that modal. A fifth affordance in the same sidebar bought prominence, not access, and pushed a broad system grant at users who never hit the bug.

Why detection is reliable

Verified against a real captured dialog rather than assumed:

AUTHREQ_PROMPTING: msgID=80871.81,
  service=kTCCServiceSystemPolicyDocumentsFolder,
  subject=Sub:{…}Resp:{TCCDProcess: identifier=…, binary_path=…}
  • One line, no correlation needed. Service and both identities arrive together, unlike AUTHREQ_CTX / AUTHREQ_ATTRIBUTION, which are split across lines joined by msgID.
  • It only fires for real dialogs. In a ~28s capture the predicate matched 1 line out of 1436 TCC lines. Routine preflight checks (preflight=yes), which dominate the subsystem, never emit it.
  • Filtering happens inside the logging system, so the process receives ~1 line per dialog rather than the ~30/s the raw subsystem produces.

The parser test uses the captured line verbatim as its fixture.

Live QA

Detection was verified end to end against the running app, not just unit tests. A throwaway bundle signed as com.stablyai.orca.local (a watched identity) triggered a real macOS consent dialog while the app was running. After the copy revision, the notice was re-rendered in the Electron app from this branch and the screenshots were refreshed:

The notice with user-facing copy:

tcc-toast-closeup-updated.png

In context:

tcc-toast-full-updated.png

The corrected settings row:

tcc-settings-closeup.png

What the run proved, in order:

  1. Watcher spawns with the exact predicate, as a child of the app.
  2. A real dialog increments the persisted tally — promptCount went 0 → 1 on the first live prompt.
  3. Silent denials are correctly not counted. After the first dialog was denied, macOS recorded a deny row and auto-denied the next attempt with no dialog — and the counter did not move. Resetting the row made it prompt and count again. This is the behaviour that makes the threshold meaningful.
  4. Threshold fires once, delivering {"promptCount":3} over the real IPC channel.
  5. The toast renders the user-facing guidance, within 1s of the dialog appearing.
  6. "Open Settings" deep-links to the macOS Permissions pane.
  7. "Don't show again" persists (dismissed: true) and stops the watcher — process count dropped to 0.

All QA state was reverted: tccutil reset All com.stablyai.orca.local, throwaway bundle deleted, isolated profile removed.

Cross-platform / scope

  • macOS-only: the watcher no-ops off darwin, the web client stubs the API, and nothing renders elsewhere.
  • The child is killed on before-quit — log stream ignores a closed stdout and would otherwise outlive the app.
  • A spawn failure is swallowed: this is diagnostics, and a missing or restricted log binary must never affect startup.
  • No new dependencies. Reuses the existing developerPermissions IPC for the settings row.
  • Non-English catalogs carry the English string as a placeholder; the bootstrap translators key their cache on the English value, so changed strings are re-translated on the next run.

Verification

vitest macos-tcc-prompt-watch + macos-tcc-prompt-notice   → 13 passed
vitest src/main/window/                                   → 227 passed
vitest src/renderer/src/components/{settings,sidebar}/    → 2400 passed
vitest src/preload/ (+ window)                            → 242 passed
oxlint + react-doctor + oxfmt --check                     → clean
typecheck:node / typecheck:web                            → both clean
verify:localization-catalog  → 10604 refs, parity across es/ja/ko/zh

Two CI-only failures were found and fixed rather than papered over:

  • Watcher tests passed vacuously on Linux. start() is darwin-gated, so on CI it no-opped and the stream/kill assertions never exercised anything. The platform is now pinned per the existing repo convention, with an explicit non-darwin case covering the gate itself.
  • The main-window suite leaked real subprocesses. attachMainWindowServices is called directly by its own unit test, so wiring the watcher there made vitest src/main/window/ spawn real log stream children that outlived the run — a single test session left two orphaned watchers. The spawn moved to the app bootstrap, which tests never execute; re-running that suite now leaves the watcher count unchanged.

Honest caveats

  • The log format is undocumented. Apple can change it in any OS release. The watcher degrades silently and never gates functionality; worst case the notice stops appearing.
  • Not yet validated against kTCCServiceSystemPolicyAppData specifically. Both the captured dialog and the live QA used SystemPolicyDocumentsFolder; on this machine AppData is never consulted (container access is a silent FDA-level deny). The event shape is service-independent and the service is a plain string match, but confirming the exact AppData path needs an affected machine.
  • This doesn't stop the prompts. Nothing in app code can. The causes are requester identity churn and macOS session-scoping platform-binary grants, both outside Orca. The durable fix is agents that sandbox their own file access, and upstream CLIs shipping from stable signed paths.
  • The counter reads system logs. The predicate is tight and only TCC events reach the process, but it is a long-running reader and deserves that disclosure.

Closes #9756

Made with Orca 🐋

Final Electron validation (post-review)

Threshold notice rendered from an isolated profile seeded at promptCount: 3:

Final threshold notice

“Open Settings” routed to Settings → macOS Permissions → Full Disk Access:

Final Full Disk Access route

…pts (#9756)

macOS shows the "Orca wants to access other apps' data"
(kTCCServiceSystemPolicyAppData) prompt and it can keep reappearing. The
reappearing loop is not a fixable app bug: it is TCC identity churn — an
unsigned local rebuild mints a new code identity each build, so macOS treats
each as a new app — and Orca's other-app reads are already gated behind opt-in
settings or explicit user actions.

The durable remedy for the population we can help (release users) is Full Disk
Access, a superset macOS grant that stops these prompts for a stable identity.
Surface it with an ambient, dismissable sidebar card that reuses the existing
developer-permissions IPC. macOS-only; probes FDA status at most once per
renderer session (the probe itself reads protected data, so it must not repeat
on focus/remount); "Open System Settings" opens the Full Disk Access pane;
permanent localStorage dismissal.
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a macOS-only Full Disk Access sidebar nudge with one-time permission probing, session caching, focus-based refresh after opening System Settings, and persistent dismissal. Integrates the nudge into the sidebar and adds translations for English, Spanish, Japanese, Korean, and Chinese. Adds tests covering visibility, permission requests, errors, StrictMode probing, focus updates, caching, dismissal persistence, and storage failures.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed It adds the macOS sidebar FDA nudge the issue's workaround-oriented fix calls for, while leaving root identity churn out of scope.
Out of Scope Changes check ✅ Passed The diff stays focused on the new sidebar nudge, tests, and locale strings, with no unrelated feature work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title matches the main change by describing the macOS TCC/FDA guidance and the new Full Disk Access surfacing.
Description check ✅ Passed The description is mostly complete and covers summary, screenshots, testing, cross-platform notes, and verification, though the template sections are not strictly labeled.
✨ Finishing Touches
📝 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/FullDiskAccessNudge.test.tsx (1)

76-85: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Clear the mocked toast call history in afterEach() vi.restoreAllMocks() won't reset the vi.fn()s created in the vi.mock('sonner', …) factory, so toast.error/message/success can leak call counts across tests. Add vi.clearAllMocks() here too.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 65b3efb3-d499-4778-ae62-ba6b58e39c70

📥 Commits

Reviewing files that changed from the base of the PR and between 300ee19 and 344d466.

📒 Files selected for processing (8)
  • src/renderer/src/components/sidebar/FullDiskAccessNudge.test.tsx
  • src/renderer/src/components/sidebar/FullDiskAccessNudge.tsx
  • src/renderer/src/components/sidebar/index.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json

The card said Full Disk Access makes "macOS stop asking", but the grant
covers this app while terminals are spawned by the detached PTY daemon
(daemon-init.ts forks execPath with ELECTRON_RUN_AS_NODE + detached:true,
reparented to launchd), which macOS treats as its own TCC identity. A user
who followed the card would grant FDA and still be prompted from terminals.
Scope the claim to reducing prompts and name the terminal caveat.
refreshFullDiskAccessStatus() applied whichever getStatus() round-trip
resolved last. Rapid blur/focus puts several in flight, so an earlier
pre-grant 'unknown' landing after a newer 'granted' un-hid the card and
also wrote 'unknown' into the module-level session cache, re-nagging a
user who already has Full Disk Access for the rest of the session. The
adjacent FullDiskAccessSetupPrompt already guards this with a refresh
sequence; mirror it here.

Also unmount React roots in afterEach: clearing document.body left them
mounted, leaking each test's window focus listener into later tests.
The afterEach unmount added in 5a0f717 only covers roots created through
renderNudge(). The StrictMode probe test builds its own root, so it was
never unmounted and its component stayed live for the rest of the file.
Today that component has no window focus listener, so nothing breaks; add
a CTA click to it and the same contamination 5a0f717 fixed comes back —
the two tests after it see extra getStatus() calls and fail. Register the
root so the fix covers every mount site.
…wn reads

The card said the prompts happen "when this copy of Orca reads protected app
data", but Orca's own reads are small and gated; #9756's trigger is agent
find/grep sweeps into ~/Library/Containers, which macOS bills to Orca because
Orca is the responsible process for every terminal child. Blaming Orca reads
as an accusation and hid why FDA works at all — the grant attaches to Orca
rather than to each churning child binary.

Name agents as the trigger, keep the "reduce" hedge and the terminal caveat,
and drop the "this copy of Orca" dev-build hedge that cost a clause. Assert
the causation wording so it can't silently regress.
…ebar card

The sidebar nudge added in 344d466 was premised on FDA being reachable
"only inside onboarding". It isn't: Settings > macOS Permissions has had a
full-disk-access row all along (searchable), the Setup Guide hosts the same
prompt from both a settings pane and a re-openable modal, and the sidebar
already links to that modal via the "Onboarding checklist" entry. The card
added a fifth affordance to the same sidebar that already had the fourth,
so it bought prominence rather than access - shown to every macOS user
without FDA, most of whom never hit #9756.

Keep the part that was actually new. The settings row still described the
prompts as something projects and worktrees trigger, which is the same
misattribution the card carried: the reads come from the agents Orca runs,
and macOS names Orca only because it is the responsible process for every
terminal child. It also never mentioned that the grant has to cover Orca
Helper, or that the preserved daemon keeps stale TCC state until restart.

Non-English catalogs get the English string as a placeholder; the bootstrap
translators key their cache on the English value, so a changed string is
re-translated on the next run.
The FDA hint is only worth showing to users macOS is actually prompting.
tccd emits one AUTHREQ_PROMPTING line per consent dialog it displays,
carrying the service and both identities, so a narrow log-stream predicate
detects the real thing without correlating across lines or guessing whether
a dialog appeared. Verified against a captured dialog: the predicate matched
1 line out of 1436 TCC lines in ~28s, because routine preflight checks - the
overwhelming majority of TCC traffic - do not emit it.

Count dialogs where Orca is the responsible process, persist across launches,
and tell the renderer on the third one. The event separates the accessing
binary from the responsible app, which is the crux of #9756, so the toast can
name the tool that triggered it rather than blaming Orca generically. One
toast per user, with a permanent opt-out; it deep-links to the FDA row in
Settings > macOS Permissions rather than restating the guidance.

macOS-only: the watcher no-ops elsewhere, the web client stubs the API, and
the child is killed on before-quit since log stream ignores a closed stdout.
@brennanb2025 brennanb2025 changed the title fix(macos): add a Full Disk Access nudge to reduce recurring TCC permission prompts (#9756) fix(macos): explain the TCC prompts, and surface Full Disk Access only to users macOS is prompting (#9756) Jul 27, 2026
# Conflicts:
#	src/renderer/src/web/web-preload-api.ts
…arwin path

start() is darwin-gated, so on Linux CI it no-opped and the stream/kill
assertions passed vacuously against a watcher that never spawned. Pin
process.platform per the existing convention (shared/secure-file.test.ts),
and cover the gate itself with an explicit non-darwin case.
…wiring

attachMainWindowServices is called directly by its own unit test, so wiring
initTccPromptNotice there made `vitest src/main/window/` spawn real `log stream`
children that outlived the run - two orphaned watchers were left behind by a
single test session. Only the IPC handler registration stays there; the spawn
moves to the real app bootstrap in index.ts, which tests never execute.

Verified: running the suite that leaked now leaves the watcher count unchanged.
Comment on lines +47 to +51
return join(getCanonicalUserDataPath(), 'macos-tcc-prompt-tally.json')
}

function loadTally(): TccPromptTally {
try {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Test-only helpers exported from production module

handleTccPromptForTests and resetTccPromptNoticeForTests are exported from the production module and ship in the main-process bundle. Any code that imports from this module can call resetTccPromptNoticeForTests() and silently zero out the persisted tally or call handleTccPromptForTests() to advance it. The typical alternative is a test-only entry point (e.g., macos-tcc-prompt-notice.test-utils.ts) that re-exports internals via vi.importActual, or moving the mutable state behind a dependency-injected factory so tests inject fresh instances directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +59 to +66
}
const service = /\bservice=(kTCCService\w+)/.exec(line)?.[1]
const accessingIdentifier = /\bSub:\{([^}]*)\}/.exec(line)?.[1]
const responsibleIdentifier = /\bResp:\{TCCDProcess:\s*identifier=([^,}]+)/.exec(line)?.[1]
if (!service || !accessingIdentifier || !responsibleIdentifier) {
return null
}
const binaryPath = /\bbinary_path=([^,}]+)/.exec(line)?.[1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 binaryPath field is mislabelled and the ORCA_APPDATA_LINE fixture is internally inconsistent

The JSDoc for binaryPath says "Absolute path of the accessing binary", but the extraction regex (\bbinary_path=([^,}]+)) matches inside the Resp:{…} block — the responsible process's path. The fabricated ORCA_APPDATA_LINE fixture has identifier=com.stablyai.orca paired with binary_path=/opt/homebrew/Cellar/node/26.5.0/bin/node, placing node's binary path inside the Orca responsible-process block. A genuine capture would show Orca's own binary there. binaryPath is unused by isOrcaAttributedPrompt, so runtime behaviour is unaffected, but the field name and fixture can mislead future readers.

Comment on lines +75 to +77
/** True when this dialog is one macOS raised in Orca's name for a watched file-access service. */
export function isOrcaAttributedPrompt(event: TccPromptEvent): boolean {
return (

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 accessingIdentifier regex silently drops events if an identifier ever contains }

/\bSub:\{([^}]*)\}/ captures up to the first }, so a raw identifier containing a closing brace would produce a truncated value and could cause the event to be dropped (the outer guard requires all three fields to be non-empty). For every known TCC log line this is fine, but Apple can change the log format at any OS release. A null return is the correct degradation path and the existing "honest caveats" section already notes this risk.

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces an always-on macOS FDA nudge with a threshold-gated toast that only appears after macOS has shown three TCC consent dialogs naming Orca as the responsible process, and corrects the settings-row copy to explain the real mechanism (agents and terminal tools trigger TCC; Orca is named because it owns the PTY).

  • Detection (macos-tcc-prompt-watch.ts): spawns log stream with a tight AUTHREQ_PROMPTING predicate, parses service + identities from each line, and counts only Orca-attributed dialogs; restarts once on transient logd failure and kills the child cleanly on quit.
  • Tally + notice (macos-tcc-prompt-notice.ts): persists the count across launches with atomic writes, uses a push/pull dual-delivery model (IPC push on threshold, consumePending pull on renderer mount), and enforces a single active claim per renderer to prevent duplicate displays across window replacements.
  • Renderer (useMacosTccPromptNotice / macos-tcc-prompt-notice-subscription.ts): gates on locale readiness before subscribing, retries once after a transient toast failure, and is StrictMode-safe (in-flight claim promises complete after effect cleanup).

Confidence Score: 4/5

Safe to merge; the watcher is darwin-only, degrades silently on failure, and never gates any user-visible functionality.

The core logic is well-designed and extensively tested. The findings are cosmetic: test helpers shipped in the production bundle, and a mislabelled binaryPath field paired with an internally inconsistent test fixture. Neither affects runtime behavior.

Files Needing Attention: src/main/macos-tcc-prompt-watch.ts — binaryPath JSDoc and ORCA_APPDATA_LINE fixture inconsistency; src/main/macos-tcc-prompt-notice.ts — handleTccPromptForTests/resetTccPromptNoticeForTests exported into the production bundle.

Important Files Changed

Filename Overview
src/main/macos-tcc-prompt-watch.ts New file: spawns log stream with a tight TCC predicate, parses AUTHREQ_PROMPTING lines, and filters for Orca-attributed dialogs. binaryPath field is mislabelled and the ORCA_APPDATA_LINE test fixture has a contradictory binary path.
src/main/macos-tcc-prompt-notice.ts New file: manages tally persistence and push/pull delivery of the threshold notice. handleTccPromptForTests and resetTccPromptNoticeForTests ship in the production bundle.
src/main/window/attach-main-window-services.ts Adds registerTccPromptNoticeHandlers: correctly scopes IPC handlers to the current main renderer via ownsNotice, handles renderer reload/crash, replaces handlers on re-attach, and cleans up on window close without disturbing newer handlers.
src/renderer/src/hooks/macos-tcc-prompt-notice-subscription.ts New file: claim-based subscription with one display retry, StrictMode-safe cleanup, and graceful degradation when any IPC method is absent.
src/renderer/src/hooks/useMacosTccPromptNotice.ts New hook: gates subscription on locale readiness to avoid blank-string toasts.
src/main/index.ts Wires initTccPromptNotice after attachMainWindowServices and calls stopTccPromptNotice in both will-quit and process.once('exit') to cover app.exit() bypass.
src/preload/index.ts Adds macosTccPrompts preload bridge with typed IPC wrappers for all five channels.
src/renderer/src/web/web-preload-api.ts Stubs macosTccPrompts for the web client with no-ops.
config/scripts/run-electron-vite-dev.mjs v6 to v7 bump forces dev bundle recreation; patches Electron Helper CFBundleIdentifier so the dev helper carries the watched com.stablyai.orca.dev.helper TCC identity.

Sequence Diagram

sequenceDiagram
    participant tccd as macOS tccd
    participant log as log stream
    participant watch as MacosTccPromptWatch
    participant notice as TccPromptNotice (main)
    participant ipc as IPC / preload
    participant renderer as Renderer (React)

    tccd->>log: emits AUTHREQ_PROMPTING line
    log->>watch: stdout line
    watch->>watch: parseTccPromptEvent() + isOrcaAttributedPrompt()
    watch->>notice: onPrompt()
    notice->>notice: recordPrompt() - promptCount++, saveTally()
    alt "promptCount < threshold"
        notice-->>watch: (silent)
    else "promptCount == threshold"
        notice->>ipc: webContents.send macosTccPrompts:threshold payload
        notice->>watch: stopTccPromptNotice()
        ipc->>renderer: onThreshold callback fires
        renderer->>ipc: consumePending()
        ipc->>notice: consumePendingTccPromptNotice(ownerToken)
        renderer->>renderer: toast.warning() shown
        renderer->>ipc: acknowledgePending(claimId)
        ipc->>notice: "tally.notified=true, saveTally()"
    end
    note over renderer: User clicks Don't show again
    renderer->>ipc: dismiss()
    ipc->>notice: "dismissed=true, saveTally()"
Loading

Reviews (1): Last reviewed commit: "perf(macos): isolate TCC notice subscrip..." | Re-trigger Greptile

@brennanb2025
brennanb2025 merged commit a8126a0 into main Jul 28, 2026
28 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…y to users macOS is prompting (stablyai#9756) (stablyai#9910)

* fix(macos): add a Full Disk Access nudge to reduce recurring TCC prompts (stablyai#9756)

macOS shows the "Orca wants to access other apps' data"
(kTCCServiceSystemPolicyAppData) prompt and it can keep reappearing. The
reappearing loop is not a fixable app bug: it is TCC identity churn — an
unsigned local rebuild mints a new code identity each build, so macOS treats
each as a new app — and Orca's other-app reads are already gated behind opt-in
settings or explicit user actions.

The durable remedy for the population we can help (release users) is Full Disk
Access, a superset macOS grant that stops these prompts for a stable identity.
Surface it with an ambient, dismissable sidebar card that reuses the existing
developer-permissions IPC. macOS-only; probes FDA status at most once per
renderer session (the probe itself reads protected data, so it must not repeat
on focus/remount); "Open System Settings" opens the Full Disk Access pane;
permanent localStorage dismissal.

* fix(macos): stop the FDA nudge promising macOS will stop asking

The card said Full Disk Access makes "macOS stop asking", but the grant
covers this app while terminals are spawned by the detached PTY daemon
(daemon-init.ts forks execPath with ELECTRON_RUN_AS_NODE + detached:true,
reparented to launchd), which macOS treats as its own TCC identity. A user
who followed the card would grant FDA and still be prompted from terminals.
Scope the claim to reducing prompts and name the terminal caveat.

* fix(macos): drop stale focus refreshes in the FDA nudge

refreshFullDiskAccessStatus() applied whichever getStatus() round-trip
resolved last. Rapid blur/focus puts several in flight, so an earlier
pre-grant 'unknown' landing after a newer 'granted' un-hid the card and
also wrote 'unknown' into the module-level session cache, re-nagging a
user who already has Full Disk Access for the rest of the session. The
adjacent FullDiskAccessSetupPrompt already guards this with a refresh
sequence; mirror it here.

Also unmount React roots in afterEach: clearing document.body left them
mounted, leaking each test's window focus listener into later tests.

* test(macos): unmount the StrictMode FDA nudge root between tests

The afterEach unmount added in 5a0f717 only covers roots created through
renderNudge(). The StrictMode probe test builds its own root, so it was
never unmounted and its component stayed live for the rest of the file.
Today that component has no window focus listener, so nothing breaks; add
a CTA click to it and the same contamination 5a0f717 fixed comes back —
the two tests after it see extra getStatus() calls and fail. Register the
root so the fix covers every mount site.

* fix(macos): attribute the FDA prompts to agent activity, not Orca's own reads

The card said the prompts happen "when this copy of Orca reads protected app
data", but Orca's own reads are small and gated; stablyai#9756's trigger is agent
find/grep sweeps into ~/Library/Containers, which macOS bills to Orca because
Orca is the responsible process for every terminal child. Blaming Orca reads
as an accusation and hid why FDA works at all — the grant attaches to Orca
rather than to each churning child binary.

Name agents as the trigger, keep the "reduce" hedge and the terminal caveat,
and drop the "this copy of Orca" dev-build hedge that cost a clause. Assert
the causation wording so it can't silently regress.

* fix(macos): explain the TCC prompts on the settings row, drop the sidebar card

The sidebar nudge added in 344d466 was premised on FDA being reachable
"only inside onboarding". It isn't: Settings > macOS Permissions has had a
full-disk-access row all along (searchable), the Setup Guide hosts the same
prompt from both a settings pane and a re-openable modal, and the sidebar
already links to that modal via the "Onboarding checklist" entry. The card
added a fifth affordance to the same sidebar that already had the fourth,
so it bought prominence rather than access - shown to every macOS user
without FDA, most of whom never hit stablyai#9756.

Keep the part that was actually new. The settings row still described the
prompts as something projects and worktrees trigger, which is the same
misattribution the card carried: the reads come from the agents Orca runs,
and macOS names Orca only because it is the responsible process for every
terminal child. It also never mentioned that the grant has to cover Orca
Helper, or that the preserved daemon keeps stale TCC state until restart.

Non-English catalogs get the English string as a placeholder; the bootstrap
translators key their cache on the English value, so a changed string is
re-translated on the next run.

* feat(macos): nudge Full Disk Access only after macOS repeatedly prompts

The FDA hint is only worth showing to users macOS is actually prompting.
tccd emits one AUTHREQ_PROMPTING line per consent dialog it displays,
carrying the service and both identities, so a narrow log-stream predicate
detects the real thing without correlating across lines or guessing whether
a dialog appeared. Verified against a captured dialog: the predicate matched
1 line out of 1436 TCC lines in ~28s, because routine preflight checks - the
overwhelming majority of TCC traffic - do not emit it.

Count dialogs where Orca is the responsible process, persist across launches,
and tell the renderer on the third one. The event separates the accessing
binary from the responsible app, which is the crux of stablyai#9756, so the toast can
name the tool that triggered it rather than blaming Orca generically. One
toast per user, with a permanent opt-out; it deep-links to the FDA row in
Settings > macOS Permissions rather than restating the guidance.

macOS-only: the watcher no-ops elsewhere, the web client stubs the API, and
the child is killed on before-quit since log stream ignores a closed stdout.

* test(macos): pin the platform so the TCC watcher tests exercise the darwin path

start() is darwin-gated, so on Linux CI it no-opped and the stream/kill
assertions passed vacuously against a watcher that never spawned. Pin
process.platform per the existing convention (shared/secure-file.test.ts),
and cover the gate itself with an explicit non-darwin case.

* fix(macos): start the TCC watcher from app bootstrap, not the window wiring

attachMainWindowServices is called directly by its own unit test, so wiring
initTccPromptNotice there made `vitest src/main/window/` spawn real `log stream`
children that outlived the run - two orphaned watchers were left behind by a
single test session. Only the IPC handler registration stays there; the spawn
moves to the real app bootstrap in index.ts, which tests never execute.

Verified: running the suite that leaked now leaves the watcher count unchanged.

* fix(macos): clarify repeated permission notice

* fix(macos): keep TCC notice lifecycle safe

* fix(macos): retain pending TCC notice delivery

* fix(macos): acknowledge TCC notice delivery

* fix(macos): release failed TCC notice claims

* fix(macos): retry transient TCC notice display

* fix(macos): contain TCC notice IPC failures

* fix(macos): harden TCC notice renderer lifecycle

* fix(macos): contain TCC notice dismissal failures

* test(macos): satisfy promise executor lint

* fix(macos): detect helper-attributed TCC prompts

* fix(macos): align TCC watcher lifecycle and helper identity

* perf(macos): defer TCC log reader until first paint

* fix(macos): recover deferred TCC watcher startup

* fix(macos): recover TCC watcher from deferred quit

* fix(macos): localize recurring file access notice

* fix(macos): preserve TCC watcher and localized guidance

* fix(macos): avoid duplicate TCC watcher recovery

* fix(macos): wait for locale before TCC notice

* perf(macos): isolate TCC notice subscriptions

---------

Co-authored-by: Brennan Benson <[email protected]>
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.

[Bug]: macOS 'access other apps' data' prompt keeps reappearing — possible from user running 'pn build' locally

2 participants