Skip to content

fix(macos): show TCC notice after first prompt - #11243

Merged
brennanb2025 merged 1 commit into
mainfrom
orca-tcc-first-prompt-notice
Jul 28, 2026
Merged

brennanb2025 merged 1 commit into
mainfrom
orca-tcc-first-prompt-notice

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • Show the Full Disk Access guidance after the first detected Orca-attributed TCC prompt instead of waiting for the third.
  • Preserve the existing one-time acknowledgment and permanent dismissal behavior.
  • Deliver prompt tallies persisted below the old threshold on the next launch without respawning the log watcher.

Why

One confirmed prompt is enough to identify an affected user. Waiting for three delays the explanation and remedy until after the user has already encountered repeated friction.

Follow-up to #9910.

Verification

  • pnpm vitest run src/main/macos-tcc-prompt-notice.test.ts src/main/macos-tcc-prompt-watch.test.ts — 28 passed
  • pnpm run typecheck:node — clean
  • pnpm run check:code-quality:changed — zero findings
  • oxfmt --check and oxlint on changed files — clean

@coderabbitai

coderabbitai Bot commented Jul 28, 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: 90001a03-7422-473a-be52-0958e61d04f1

📥 Commits

Reviewing files that changed from the base of the PR and between d3681f6 and b5e6fa2.

📒 Files selected for processing (2)
  • src/main/macos-tcc-prompt-notice.test.ts
  • src/main/macos-tcc-prompt-notice.ts

📝 Walkthrough

Walkthrough

The TCC prompt notice threshold changed from three detected prompts to one. Tests now expect the notice to fire on the first dialog, use the threshold constant for prompt counts, preserve persisted counts below the former threshold, and retain existing claim delivery and acknowledgement behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, rationale, and verification, but it omits required Screenshots, Testing, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including screenshots or 'No visual change', the testing checklist, review report, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: showing the TCC notice after the first prompt on macOS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
📝 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.

@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Greptile Summary

Lowers TCC_PROMPT_NOTICE_THRESHOLD from 3 to 1 so the Full Disk Access guidance is shown to a user as soon as the first Orca-attributed TCC dialog is detected, rather than waiting for the third.

  • The one-prompt threshold change is the only behavioral delta in the implementation; all guard logic in recordPrompt and initTccPromptNotice (including the persisted-tally path for users who had a count of 1 or 2 under the old threshold) is correct at the new value.
  • Tests are updated to use the exported TCC_PROMPT_NOTICE_THRESHOLD constant instead of the hard-coded literal 3, and a new test covers the migration path where a tally persisted below the old threshold is delivered on the next launch without respawning the watcher.

Confidence Score: 5/5

Safe to merge — this is a single-constant change with thorough test coverage across all affected paths.

The change is minimal: one constant drops from 3 to 1 and tests are updated to match. The guard logic in recordPrompt (pre-increment check tally.promptCount >= THRESHOLD, post-increment check tally.promptCount < THRESHOLD) is mathematically correct at threshold=1. The persisted-tally migration path in initTccPromptNotice (promptCount >= 1 triggers immediate delivery without starting a watcher) works correctly for both fresh tallies and tallies carried over from the old three-prompt regime. All 28 existing tests continue to validate one-time notice semantics, claim/release/acknowledge lifecycle, renderer routing, and deferred watcher startup.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
src/main/macos-tcc-prompt-notice.ts Changes TCC_PROMPT_NOTICE_THRESHOLD from 3 to 1 and updates the JSDoc comment; all guard logic in recordPrompt and initTccPromptNotice is correct at the new value.
src/main/macos-tcc-prompt-notice.test.ts Tests updated to use TCC_PROMPT_NOTICE_THRESHOLD constant instead of literal 3, adds migration-path coverage for tallies persisted below the old threshold, and renames tests to match the new behaviour.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[initTccPromptNotice called] --> B{platform === darwin?}
    B -- No --> Z[return]
    B -- Yes --> C{watch already active?}
    C -- Yes --> D[trackMainWindow + startWatch]
    C -- No --> E[loadTally from disk]
    E --> F{dismissed or notified?}
    F -- Yes --> Z
    F -- No --> G{promptCount >= THRESHOLD now = 1}
    G -- Yes --> H[sendTccPromptNotice immediately, no watcher started]
    G -- No --> I[trackMainWindow, start MacosTccPromptWatch]
    I --> J[onPrompt callback fires]
    J --> K[recordPrompt]
    K --> L{dismissed / notified / promptCount >= THRESHOLD?}
    L -- Yes --> M[return null]
    L -- No --> N[increment promptCount, saveTally]
    N --> O{promptCount >= THRESHOLD?}
    O -- No --> M
    O -- Yes --> P[return payload, renderer notified, stopTccPromptNotice]
Loading

Reviews (1): Last reviewed commit: "fix(macos): show TCC notice after first ..." | Re-trigger Greptile

@brennanb2025
brennanb2025 merged commit bb9ae78 into main Jul 28, 2026
26 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
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