Skip to content

fix(doctor): advise when Claude Desktop's TCC-disclaiming launcher will block Hopper - #11685

Open
Diego-9612 wants to merge 2 commits into
morluto:mainfrom
Diego-9612:fix/doctor-claude-desktop-apple-events
Open

Diego-9612 wants to merge 2 commits into
morluto:mainfrom
Diego-9612:fix/doctor-claude-desktop-apple-events

Conversation

@Diego-9612

@Diego-9612 Diego-9612 commented Nov 16, 2026 •

Copy link
Copy Markdown

Summary

Refs #11597 (proposal 3). Complements #12309 (merged), which fixed the denial's message and remediation. This PR warns earlier, from rea doctor, before any Hopper call fails.

On macOS, a Claude Desktop registration makes every Hopper-backed operation fail with an Apple Events denial, but rea doctor still reports Hopper as available, so nothing warns the user before analysis fails. This PR adds a non-blocking doctor advisory for that combination.

Problem and expected behavior

Claude Desktop starts MCP servers through Contents/Helpers/disclaimer --pgroup -- <server>, which disclaims TCC responsibility. tccd then attributes Hopper's Apple Events to REA's runtime (node/bun) and denies them without prompting (responsible=… node, Policy disallows prompt; evidence in #11597 and in my verification on #11636). Before this change, rea doctor --client claude_desktop on that host returned healthy: true with no hint.

Expected: when a Claude Desktop registration exists and a Hopper launcher is configured or detected on macOS, doctor names the conflict and the working recovery (register with a client that keeps TCC responsibility, such as Claude Code, or start REA from Terminal).

Change and scope

  • src/application/SupportedClients.ts: declare the client fact once as disclaimsMcpServerTccResponsibility: true on claude_desktop, exposed through tccDisclaimingClientDisplayName(name).
  • src/application/Doctor.ts: registrationAppleEventsChecks emits registration_apple_events:<client> next to the existing registration_timeout:<client> advisory, using the same shape (ok: true, classification: "healthy"). Conditions: platform === "darwin", the client has a REA registration (command non-empty), and a Hopper launcher is configured, detected, or recorded in that registration. The name intentionally does not start with hopper, so it is not treated as a provider check and does not affect hopperAvailable, healthy or environment_healthy. In scoped runs it lands in informational_checks.
  • src/application/ClientRegistrationEnvironment.ts and ClientRegistrationStatus.ts: expose records_hopper_launcher: true, without the value, for clients that disclaim TCC responsibility. (Review follow-up, 7c79786.)
  • docs/getting-started/client-configuration.md: document the behavior in the Claude Desktop section. installation.md is left alone to avoid overlapping fix(hopper): name the TCC-disclaimed runtime in Apple Events denial guidance #11636.

Not included: a failing check, any setup or registration change, and the broader macOS permission readiness in #4311. Open question for maintainers (also asked in #11597): keep this advisory, or make it a failing scoped check when hopper is a selected provider? I defaulted to advisory, since static and non-Hopper operations still work from that registration.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the client fact is owned by SupportedClients.ts, and doctor consumes it through tccDisclaimingClientDisplayName. Doctor's existing registration statuses and Hopper path facts are reused, not reinterpreted.
  • Contribution scope fit and linked maintainer decision: not applicable (diagnostic advisory within existing doctor boundaries; no execution, injection or mutation).
  • CLI and MCP/tool-catalog contract: an optional records_hopper_launcher field in doctor's registration identity, and one additional check in doctor's checks / informational_checks arrays, with the existing DoctorCheck shape. No schema or tool-catalog change.
  • Provider, bridge, target-format, or platform compatibility: macOS only; no change on Linux or Windows.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data. (Doctor already reads client registration files; this PR adds no new reads.)
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/application/Doctor.test.ts, describe("Apple Events attribution advisory"):

    • the advisory appears for claude_desktop + Hopper on darwin, with healthy: true;
    • no advisory on Linux, without a configured or detected Hopper launcher, for claude_code, or for a missing Claude Desktop registration.
  • Base reproduction or other evidence:

  • User-visible CLI/MCP output: real rea doctor from this branch's build, with a temporary HOME containing a Claude Desktop registration and HOPPER_LAUNCHER_PATH set:

    healthy: true
    scope: registration:claude_desktop ok
    informational: registration_apple_events:claude_desktop ok=true classification=healthy
      Claude Desktop starts MCP servers through a helper that disclaims macOS TCC responsibility, so macOS attributes Hopper's Apple Events to REA's runtime (node/bun) and denies them without prompting. Hopper-backed analysis from this registration is expected to fail; register REA with a client that keeps TCC responsibility, such as Claude Code, or start it from Terminal.
    

    With my real HOME (Claude Desktop has no REA registration), no registration_apple_events:* check is emitted.

  • Remaining proof gaps:

    • the client fact is declared statically from Claude Desktop 5.11492.5 on macOS 26.6.2; other Claude Desktop versions are unverified;
    • Bun is unverified;
    • doctor does not observe the actual process tree, so a future Claude Desktop that stops disclaiming responsibility would still get the advisory until the fact is updated.

Validation performed

Current revision: 7c7978626, rebased onto main e896f6054 (24-nov). The rebase had no textual conflict, but the tests no longer compiled because main removed DoctorHost.validTarget; that override is dropped. Results on this revision:

  • npx vitest run src/application/Doctor.test.ts src/application/DoctorRegistrationEnvironment.test.ts — 109 passed. Three mutations of the follow-up each fail one regression.
  • npm run check:fast — passed. npm run docs:check — passed.
  • npm run check:changed — 687 passed, 2 skipped, 1 failed (DesktopBuildDoctorFacts gzip test, which also fails on unmodified e896f6054 on this host).
  • Real rea doctor with a temporary HOME and the launcher recorded only in the registration — advisory present with --client claude_desktop, no scope, --provider hopper, and two clients; with --client claude_desktop, absent when the registration records no launcher.

Earlier revisions:

Rebased onto main at 436977b0 (21-nov). The only conflict was in src/application/SupportedClients.ts: main removed supportedClientRegistrationProfile (moved to a test fixture in 48e27e19) next to the new tccDisclaimingClientDisplayName. I kept the new helper and the removal. After the rebase:

  • npm run test:focused -- src/application/Doctor.test.ts src/application/Doctor.lifecycle.test.ts src/application/DoctorRegistrationEnvironment.test.ts — 113/113 passed.
  • npm run check:fast — passed. npm run docs:check — passed (8/8).
  • npm run build:cached and real rea doctor — advisory present with a Claude Desktop registration and Hopper (healthy: true), absent with my real HOME.

Original validation (before the rebase):

All on macOS 26.6.2 arm64 with Node 24.22.1 (.nvmrc).

  • npx vitest run src/application/Doctor.test.ts (after rebasing onto f14e9a1) — 96/96 passed.
  • npm run test:focused -- src/application/Doctor.test.ts src/application/Doctor.lifecycle.test.ts src/application/DoctorRegistrationEnvironment.test.ts (on 7af53a1, before rebase) — 111/111 passed.
  • npm run check:fast (after rebase) — passed.
  • npm run docs:check (before rebase) — passed (readme consistency 8/8).
  • npm run check (before rebase):
    • typecheck, lint, format:check and metadata:check passed;
    • knip failed with the same unused-file/export list on the unmodified base 7af53a1 (src/cli/domainInput.ts, src/cli/options.ts, …), so it is pre-existing;
    • verify:architecture-guards and knip:production passed when run individually;
    • lint:typed reported 4 switch-exhaustiveness-check errors, all in files this PR does not touch (src/domain/jsonDuplicateMember.ts, src/browser/CdpCaptureEvents.ts, src/browser/CdpObservationSession.ts, src/inspector/V8InspectorProvider.ts). Not re-run on base.
  • npm run build:cached, then the real rea doctor runs shown above — advisory present in the positive case, absent in the negative case.

Compatibility, safety, and release

Author readiness

Human owner: @Diego-9612

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change stays within a narrow macOS diagnostic path.

The PR appears safe to merge, with a non-blocking gap for Hopper paths saved only in client settings.

Findings

  1. P2 Saved Hopper paths miss warning ▶
Fix with agent prompt
### Issue 1
src/application/Doctor.ts:282-286
If Hopper is configured only in the saved Claude Desktop settings and sits outside the searched folders, this check skips the advisory. For example, run `rea setup` with `HOPPER_LAUNCHER_PATH=/custom/Hopper`, then run `rea doctor --client claude_desktop` from a shell without that variable. Both paths passed here are undefined, so users get no Apple Events warning before analysis fails.

Have the registration reader expose whether it records a Hopper launcher, without exposing the saved value, and include that fact in this check.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Adds a macOS doctor advisory for Claude Desktop registrations when Hopper is configured or found.

  • Doctor warns when Claude Desktop and Hopper may clash on macOS.

Acknowledgments: Diego-9612 explicitly chose a non-blocking advisory and disclosed that the static client fact may become stale across Claude Desktop versions. Neither is reported as an issue.

Review limits: Tests were not run. Checking for a superseding PR or existing review threads was blocked because GitHub authentication was unavailable.

Reviews (1) · Last reviewed commit: "fix(doctor): advise when Claude Desktop'..." · Reviewed by Greptile

Comment thread src/application/Doctor.ts Resolved
@Diego-9612
Diego-9612 marked this pull request as ready for review November 16, 2026 03:59
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T03:59:29.338022Z
We couldn’t complete this review. Comment @codex review to try again.
17ba686 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@Diego-9612

Copy link
Copy Markdown
Author

Friendly ping: this is now rebased onto current main with no conflicts, and it complements #12309, which is already merged. #12309 fixed the denial's message; this PR warns earlier, from rea doctor, before any Hopper call fails. Verified on macOS with a real Hopper (details in the description).

Could a maintainer approve the CI workflows when convenient? I'm happy to switch the advisory to a failing scoped check if you prefer that.

@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working provider: hopper Analysis provider / engine: hopper labels Nov 22, 2026
@morluto

morluto commented Nov 24, 2026

Copy link
Copy Markdown
Owner

@Diego-9612 thanks for the PR — there is 1 open review thread here:

Could you address or reply to this? Once it's resolved and CI is green we can take another look.
cc @gensokyo-dev @dandgabr

Diego-9612 and others added 2 commits November 24, 2026 16:33
…ll block Hopper

On macOS, Claude Desktop starts MCP servers through
Contents/Helpers/disclaimer, which disclaims TCC responsibility. macOS then
attributes Hopper's Apple Events to REA's runtime (node/bun) and denies them
without prompting, while doctor still reported Hopper as available.

Declare the client fact once in SupportedClients and add a non-blocking
registration_apple_events:<client> advisory, emitted on darwin when the
client has a REA registration and a Hopper launcher is configured or
detected. Health, setup and registrations are unchanged.

Refs morluto#11597

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Apple Events advisory looked at the launcher this process selected or
detected, so it missed one recorded only in the Claude Desktop
registration. Registration status now exposes whether the file records
HOPPER_LAUNCHER_PATH, without its value, for clients that disclaim TCC
responsibility. An unreadable environment establishes nothing.

Use doctor's effective configured launcher, which includes REA's user
configuration, instead of only the terminal's environment.

Drop the validTarget override, which main removed from DoctorHost.

Refs morluto#11597

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Diego-9612

Copy link
Copy Markdown
Author

The saved-path thread is addressed and resolved in 7c79786, and the branch merges cleanly into current main. The checks are waiting for workflow approval.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants