Repository navigation
fix(hopper): recover from a Spotlight not-found launch - #2795
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b8772ae106
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f596d0862f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Review findings addressed at their producing boundaries and consumers. Latest changes were reviewed from source; tests and provider runs were skipped at the maintainer's request. Findings requiring separate decisions or verification remain open. The exact stderr signature was accepted without proving stdout was empty, so extra wrapper output could incorrectly establish pre-handoff shutdown. Both native not-found and authorization-denial predicates now share the complete-output condition: output closed, diagnostics untruncated, and stdout text plus observed/retained byte counts all empty. The launcher continues to leave shutdown unconfirmed for other reports. Extended both diagnostic matrices with visible stdout and observed-but-not-retained stdout cases. Current source: f596d08. Validation: source inspection only; authored regressions were not executed. Tests, checks, builds and provider execution were skipped at the user's explicit request. No passing runtime or real-provider result is claimed. Directly related representation and consumer cleanup is included. |
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. The root cause was treating a complete launcher report as proof of native pre-handoff control flow. Launcher diagnostic observation no longer sets shutdownConfirmed. Renamed predicate to report semantics and removed obsolete native-control-flow claim. Complete stderr is actionable Spotlight guidance only. Acceptance coverage now exercises both ordinary unknown handoff and identical not-found report with a late bridge, retaining runtime/lease until matching identity cleanup. Public source: aa3628c. Validation: source/diff inspection of the producer and affected consumers. Tests and all executable checks were skipped at the user's explicit request. Directly related superseded interpretation was removed; no remaining cleanup for this code finding. No real-provider verification is claimed. |
|
Source fixes and publication evidence for the review findings below. Tests and executable checks were skipped at the maintainer's request. Findings that still require a decision or execution evidence remain open. Generic launcher diagnostics were treated as proof that native recovery had not crossed handoff, which could authorize unsafe spotlight recovery. The producer now grants that recovery only from native pre-handoff evidence. Public at aa3628c; no tests/checks ran. |
aa3628c to
5d67ec1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d67ec1847
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (hopperLauncherReportedApplicationNotFound(launcherFailure)) { | ||
| return new HopperStartError({ |
There was a problem hiding this comment.
Recover only provenance-verified Spotlight exits
When the configured executable is the real unmodified macOS Hopper helper and its Spotlight lookup fails—the case this change is meant to recover—this branch returns a better error but never sets shutdownConfirmed. The fresh final branch removed confirmation altogether rather than adding the provenance gate requested earlier, so cleanupHopperSession retains the external-application runtime and target lease, subsequent open_binary calls remain blocked, and the updated not-found acceptance row now explicitly expects cleanup_incomplete. Carry verified native-helper provenance from BridgeLauncher and confirm only that variant while continuing to leave custom wrappers unknown.
AGENTS.md reference: AGENTS.md:L19-L21
Useful? React with 👍 / 👎.
Hopper's native launcher locates the application through a fixed Spotlight query before any Apple event. With indexing disabled it exits 3 with a not-found report, but REA treated the external document as unconfirmed, retained the runtime and failed every later open_binary until the server restarted. Recognize the complete report as a pre-handoff failure, confirm no document exists, and tell the caller to enable Spotlight indexing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
5d67ec1 to
03f907d
Compare
Summary
Hopper's native launcher locates the application through a Spotlight query before sending any Apple event. When Spotlight indexing is disabled for the volume, the launcher exits 3 with
Hopper has not been found…. REA treated that external document as unconfirmed, kept the runtime, and every lateropen_binaryfailed until the MCP server restarted. Refs #1808: same family (a failed launch leaves the session unusable), but #1808 covers a different exit, so this does not close it. This follows the recovery pattern of #1817 and completes #1105, which made the Spotlight error visible but still retained the runtime.Problem and expected behavior
open_binarywith Spotlight indexing off (mdutil -s /reports disabled).mdutil -i on). A lateropen_binaryin the same session works once Hopper can be found.Change and scope
nativeHopperApplicationWasNotFoundinsrc/hopper/HopperProcessDiagnostic.ts.HopperClient.#launcherStartupFailurethat marks shutdown as confirmed.Ordinary fix within existing boundaries; maintainer scope decision: not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage: Hopper launcher diagnostics (
src/hopper).Contribution scope fit and linked maintainer decision: bug fix; not applicable.
CLI and MCP/tool-catalog contract: no schema change; new error message text for this case.
Provider, bridge, target-format, or platform compatibility: macOS Hopper launcher only.
Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details: cleanup now completes for this failure, so the runtime is not retained.
Generated metadata, package, or installation impact: none.
Launch or attach to a process.
Evidence and regression coverage
Tests added or updated: unit cases in
src/hopper/HopperProcessDiagnostic.test.ts; acceptance testrecovers a Spotlight not-found Hopper launch without restarting the MCP sessionintests/acceptance/providers/hopperStartupRecovery.test.ts, using a newnot-foundmode intests/fixtures/hopperLaunchAdmission.mjs.Base reproduction: with
HopperClient.tsandHopperProcessDiagnostic.tschecked out frommain, the new acceptance test fails; with the change it passes.Observed on a real machine: with indexing disabled, every
open_binaryfailed until the server restarted; after enabling indexing, Hopper was found.Remaining proof gaps:
retains a denial-shaped failure when caller arguments can alter the helper's AppleScriptin the same acceptance file fails locally onmainas well (ENOENT onloader-targetduring teardown). It is unrelated to this change, but I could not confirm whether it is specific to my environment.Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run test:focused -- src/hopper/HopperProcessDiagnostic.test.ts tests/acceptance/providers/hopperStartupRecovery.test.ts— 18 passed, 1 failed (the pre-existing test above)main— the new acceptance test fails as wellnpm run check:fast— typecheck and lint passednpm run verify:hopper(macOS, Hopper Disassembler 6.6.0-demo) — launch and conformance fixtures verified ("verified":7), then the run stops atAssertionError: fixture omitted its real long literalinscripts/lib/real-hopper-search.mjs:127. The same assertion fails onmain(d853744) on this host, so it is pre-existing and appears tied to string recognition in the demo build, not to the launcher path changed here.Compatibility, safety, and release
Before merge
type(scope): outcome.🤖 Generated with Claude Code