Repository navigation
fix(hopper): preserve startup failures and recover denied launches - #1817
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: 02d4c2edb6
ℹ️ 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".
N0zoM1z0
left a comment
There was a problem hiding this comment.
Reviewed the startup-failure, retained ownership, authenticated cleanup, and bridge reconnect paths. The exact contributor head is 02d4c2edb6eeab2e91bc076b14605b9384222992; all 31 check runs are successful.
On a separate branch composed with main ed1519ddee02739f57136e356786f64c7f74fed0, the expected Git merge tree matched the tested tree. A fresh runtime and MCP bundle build passed, followed by 65 focused configuration/diagnostic/cleanup/handshake/bridge tests. The ordinary focused prerequisite rebuild exceeded the bounded memory budget before reaching tests; the exact runtime and skill prerequisites were subsequently generated with the compiler's single-threaded mode and the same planned tests passed.
Real headless Linux Hopper 6.4.2-demo on a 23 KiB source-built ELF passed the public MCP semantic workflow: known call edges, string/global references, CFG, pseudocode, ephemeral comment readback, malformed-selector recovery, close/reopen, unchanged target digest, and canonical output schemas. Private runtime cleanup completed. This verifies Linux engine and owned-process behavior; it does not establish macOS AppleEvents denial, macOS SIGSEGV recovery, or saved-HOP behavior. The reauthentication protocol is separately covered by the shipped Python bridge test.
The later main change 5876779013726964deef748120c48f5fa0155546 changes README files only. Runtime, bridge, contracts, scripts, dependencies, and TypeScript configuration are unchanged relative to the tested base; its merge tree is conflict-free.
Refs #1808.
After a native Hopper launch failed, REA retained an unconfirmed GUI handoff but discarded the startup result. Later tools returned
unreadable_outputfrom an unrelated "already started" error, and operational health lost the original cause. Preserve the typed startup failure and launcher diagnostics while cleanup is pending, including deadlines during the initial health handshake.Release a denied launch only when the helper returns its complete Apple Events authorization rejection (exit 2, no signal, closed and untruncated output) and all native invocation arguments are literal-safe. The vendor helper interpolates arguments into AppleScript without escaping: a real Hopper 6.6 probe opened a document and then emitted the identical rejection. Quotes, backslashes, and line breaks therefore withhold the pre-handoff conclusion without changing caller inputs. Other ambiguous failures retain the runtime and target reservation. An established denial reports the macOS Automation remedy and permits retry.
Cleanup requires a successful token-authenticated health handshake with the exact run identity. Disconnect a rejected initial handshake before cleanup so it cannot authorize document shutdown. Explicit close can reconnect to a late bridge or a previously valid session whose transport failed. The shipped Python bridge now accepts successive connections, survives disconnected writers, and remains available after an unconfirmed shutdown. Its idle reconnect window is 30 seconds, matching the cleanup handshake budget; expiry releases Hopper's Python execution thread without claiming document closure.
Add
REA_HOPPER_STARTUP_TIMEOUT_MSto shared CLI/MCP provider configuration, using the same validated integer range as Ghidra and retaining Hopper's 120-second default. Document timeout and recovery behavior. Replace the touched CLI test's global lease scan with recovery of its exact target through the production lease API.Validation:
npm run check,npm run docs:check,npm run verify:test-discovery, and the pre-push check passed; all 838 test files are discovered exactly once.npm run verify:hopperpassed on Hopper 6.6.0-demo after these changes: 200 successful calls, 63 expected rejections, confirmed cleanup, and survival of an unrelated process. The original change also passed on Hopper 6.1.0-demo.cleanup_incomplete, retained its exact runtime, preserved the failure on repeated calls, and refused to claim successful close. A separate authenticated session observed document creation, and explicit probe cleanup confirmed the exact executable path. This supersedes the earlier inference that matching diagnostic text alone established no handoff. The initial 6.1/6.6 fault probes establish diagnostic compatibility only; simulated denial recovery does not establish a real Claude Desktop TCC-denial reproduction.analyze /usr/libexec/sharingd --provider hopper --jsonwith Hopper 6.6 andREA_HOPPER_STARTUP_TIMEOUT_MS=900000exited successfully in 46.30 seconds, returning 41,920 procedures and 25,495 strings. Hopper returned to idle and no new Hopper crash report appeared. This host runs macOS 26.3 arm64, not the reporter's macOS 27.The native helper does not expose a structured authorization error. Changed or localized diagnostics, incomplete output, signals, and other script failures retain conservative ownership. The reporter's macOS 27 Hopper SIGSEGV remains unverified; launcher exit 0 and missing bridge readiness do not establish a GUI crash.