mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #2975] [Bug] macOS: after the Hopper app exits, the MCP session cannot open any target until the server restarts #1046
Open
opened 2026-10-15 18:30:38 +00:00 by bsakaguchi
·
2 comments
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
morluto/rea#1046
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dogskip on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2975
Before submitting
Area
MCP or agent integration
Observed behavior
On macOS, once the Hopper application exits while an MCP session has a Hopper target open, that session cannot open any target again, for any provider, until the MCP server restarts. The remediations REA returns along the way point at a recovery that cannot succeed.
After the exit:
provider_unavailable(retryable: true,retry_action: "restart_provider"), whose remediation says: "Restart the owned provider by calling close_binary, then open the target again and retry."close_binaryreturnscleanup_incomplete(retryable: false), listinghopper-document("authenticated shutdown acknowledgement was not observed") and the private runtime directory, with the remediation "Review the reported local resources before opening another target."open_binaryreturns the samecleanup_incomplete, including when called withprovider_id: "ghidra"; the error still names"provider_id": "hopper"and"operation": "close_binary".On main,
close_binaryand eachopen_binarywait 30 s before failing; on 6.4.0 they fail at once. A newrea mcpprocess opens and analyzes the same targets normally.This follows the documented fail-closed rule (
docs/installation.md#L460-L469): "After addressing the reported failure, retryclose_binaryon the same connection", "Unconfirmed document or process cleanup retains the target/application lease", and "If that bridge has disconnected, another close cannot confirm the document: inspect and close the reported document in Hopper before ending the owning REA connection." #1275 likewise keeps an external GUI document unconfirmed when only the owned helper stops. This report does not ask to relax that rule. It reports two gaps: once Hopper itself is gone there is no document left to inspect or close, yet nothing in REA can confirm it afterwards; and neither in-band remediation mentions ending the connection, the only step that recovers.Reproduction
/Applications. Startrea mcp(stdio) and initialize.open_binary {"path": "<arm64 Mach-O>", "provider_id": "hopper"}, thenanalyze_functionon one function: Evidence.kill <pid>(SIGTERM) on.../Hopper Disassembler.app/Contents/MacOS/Hopper Disassembler, and wait until the process is gone.analyze_functionon another function:provider_unavailable.close_binary:cleanup_incomplete.open_binarywith the same path andprovider_id"hopper"or"ghidra", more than once:cleanup_incompleteevery time.rea mcp.open_binaryandanalyze_functionon the same target: success.Each run drove the servers over stdio from a small script and confirmed the Hopper process was gone before step 4:
provider_unavailable3/3cleanup_incomplete3/3, 0 scleanup_incomplete3/3, 0 sprovider_unavailable3/3cleanup_incomplete3/3, 0 scleanup_incomplete3/3, 0 sae9a7f34eprovider_unavailable3/3cleanup_incomplete3/3, 30 scleanup_incomplete3/3, 30 s each204a6f3f2provider_unavailable3/3cleanup_incomplete3/3, 30 scleanup_incomplete3/3, 30 s eachebaaa79caprovider_unavailable3/3cleanup_incomplete3/3, 30 scleanup_incomplete3/3, 30 s eachOne further run on
204a6f3f2was discarded because step 2 returnedcleanup_incompleteafter 120 s instead of Evidence. Two more runs onebaaa79caskipped step 5 and went straight to step 6: eachopen_binarystill returnedcleanup_incompleteafter 30 s (2/2).The exit in these runs was a forced termination. An AppleScript quit (
osascript -e 'tell application "Hopper Disassembler" to quit') left Hopper running in 7/7 runs. In the one run whoseosascriptoutput and windows were read, it failed with an Apple event timeout (-1712) while Hopper showed REA's "Executing Python Script..." (see #494 for that long-running bridge script). A Cmd-Q was not tried.The Hopper demo leads to the same exit. About 30 minutes after launch it shows a modal alert, "Demo period has expired. Document will be closed.", whose only button is OK. Hopper keeps running behind the alert (still up about 70 minutes after launch in one 6.4.0 run), and pressing OK quits it at once. Afterwards
close_binaryand anopen_binaryfor Ghidra both returnedcleanup_incompleteafter 30 s (2/2 runs on204a6f3f2, with the script pressing OK).Expected behavior
Two parts:
provider_unavailablecannot tell an exited Hopper from a lost transport, and when the transport is lost but the bridge still listens, cleanup through close is tested (hopperClient.handshakeRecovery.test.ts#L181-L206), so that advice can stay. It could add that if Hopper is no longer running,close_binarywill not confirm cleanup, so the Evidence bundle should be exported first. When the retained Hopper document cannot be confirmed and its bridge is disconnected, the Hopper-specific details ofcleanup_incompletecould say what the docs say: close the document in Hopper and then end the MCP connection; if Hopper is no longer running, end the connection. The shared message (providerCleanupError.ts#L10) need not change. The installation docs could add that the demo stops about 30 minutes after launch and that pressing OK on its alert quits Hopper, which ends Hopper's use in the current session.open_binarystart Hopper again. This extends to a post-handoff exit the invariant #2795 states for a failed launch: the session stays reusable.Impact and scope
external-application(only the Linux demo owns the process lifetime; see the analysis below). For a long-lived MCP client, one Hopper exit blocks every provider (Ghidra shown above) until the client restarts its server.close_binary(mcp-contracts.md#L273-L276), yet the session still cannot continue:get_evidence_bundleheld 1 record beforeclose_binaryand 0 after (3/3 onebaaa79ca). Skippingclose_binarykeeps the record since #2754 (1 after the failed opens, 2/2), but the session is just as stuck. A restarted server starts with a fresh ledger, so the records survive only if they are exported before the restart, and before anyclose_binary.rea function --provider hopperthen started a new Hopper and returned Evidence (3 runs on204a6f3f2, 5 onebaaa79ca). While that server is alive it keeps the target lease, and a CLI call on the same target is refused as "already open in REA session …".REA version
rea-agents 6.4.0 (npm), and main at
ae9a7f34e,204a6f3f2andebaaa79ca(npm ci --ignore-scripts && npm run compile); all reproduce. Betweenae9a7f34eandebaaa79ca, the only commit that touches the Hopper or session code cited below isaf7638fa9(#2754), which keeps the records after a failed open but does not change this outcome. Main has since moved to7a6defab1; its two new commits touch none of the files cited here.Runtime and platform
macOS 27.2 (26B5101f), arm64. Node.js 26.0.0. Hopper Disassembler 6.6.0-demo (build 42.6316032). Ghidra 12.1.4 for the Ghidra target.
rearan through a local shell wrapper that exportsGHIDRA_INSTALL_DIR,JAVA_HOME(arm64 JDK 21),REA_ANALYSIS_PROVIDER=ghidraandREA_IDA_MCP_CONFIGbeforeexec-ing REA. The wrapper can also stop a Hopper process older than a set age; no Hopper in these runs reached that age.Target and artifact context
Any target. Reproduced with a small arm64 Mach-O compiled locally.
Interface
MCP
Earliest failure stage
Cleanup, cancellation, or lifecycle
Relevant output or evidence
Step 4 on
ebaaa79ca, identical on204a6f3f2(a function not analyzed earlier in the session, so the call reaches Hopper):Step 5 on
ebaaa79ca, identical onae9a7f34e(runtime path redacted); everyopen_binaryat step 6 returns the same error:Typed outcome or recovery expected
After a verified exit:
close_binarysucceeds, andopen_binarysucceeds for Hopper (relaunching it) and for other providers. Without one: retained cleanup as today, with Hoppercleanup_incompletedetails that name restarting the MCP connection when the bridge is disconnected and Hopper is not running, and a Hopperprovider_unavailableremediation that says to export the Evidence bundle beforeclose_binaryif Hopper may have exited.Analysis or suspected cause
Source-derived, at
ebaaa79ca; not confirmed by instrumentation.external-applicationwithbridge-requestshutdown, becauseconst ownsProcessLifetime = usesLinuxDemo(this.options)(BridgeLauncher.ts#L165) is false there (#L250-L259). REA owns the launcher helper, not the app.#reconnectForCleanup(HopperClient.ts#L549) retriesbridge.sockwithinHOPPER_SHUTDOWN_TIMEOUT_MS(30 s), the retry #1866 added; this is the 30 s per call on main, and 6.4.0 predates it. Nothing can answer, so the acknowledgement never arrives.open_binaryretries that pending cleanup first and returns its error (BinarySession.ts#L265-L266) whatever provider is requested, which explains the Ghidra rows. Whenclose_binaryis skipped, the firstopen_binaryfails the same way while retiring the previous client (#L280-L291), and later ones at the pending retry.healthreply carriesname,versionandrun_idbut no process identity (hopper_bridge.py#L732-L733), so REA cannot tell an exited app from a lost transport. The tests cover a helper exit that does not prove a GUI exit (hopperClient.helperFailure.test.ts#L82) and a lost transport whose app is still alive (hopperClient.handshakeRecovery.test.ts#L181), but not an exited app.A possible fix that keeps cleanup fail-closed and reuses
src/processidentity, as AGENTS.md asks:os.getpid()in its authenticatedhealthreply. The bridge's Python runs inside the Hopper process:lsofshows the Python framework mapped into the Hopper app process, which also holds thebridge.sockdescriptors.observeProcessStartIdentity(ProcessOwnershipObservation.ts#L458); on Darwin that identity is thekp_proc.p_starttimesecond and microsecond pair.BridgeLauncher.tstreats a failed probe as "not running", so it should not be reused here.Additional context
Related but not duplicates:
open_binaryduring startup leaves the session unusable.open_binary; the session above still cannot open a target.Proposed regression test, next to
hopperClient.handshakeRecovery.test.ts: anexternal-applicationfixture whose app process exits after a successfulhealth.close()then succeeds without an acknowledgement, the runtime directory and lease are released, and a lateropen_binaryfor Hopper or another provider succeeds in the same session. A second case keeps the process alive, or makes its identity unreadable, and expects today's retained cleanup.@trigger2k20 commented on GitHub (Oct 14, 2026):
Consolidating my duplicate report #3269 here.
Additional report context: rea-agents 6.4.0, Hopper 6.6.0, macOS 27.0.1 arm64, native launch. After opening a small Mach-O and confirming a successful query, terminating Hopper caused close_binary and subsequent open_binary calls to return cleanup_incomplete until the MCP server restarted.
My report traces the retained state through HopperCleanup and BinarySession pending cleanup. It also connects this recovery failure with the startup-timeout scenario in #3268: terminating a timed-out Hopper instance can leave the same session blocked.
Correction to my proposed fix: processStopped alone is insufficient if it describes the launcher/helper. Cleanup must require positive proof that the exact external Hopper process serving the authenticated bridge has exited, preserving retained cleanup when that identity cannot be verified. This aligns with the approach already described here.
The complete original report and version-specific references remain available in #3269.
@morluto commented on GitHub (Oct 14, 2026):
Delivered on main in fffb07419.
External Hopper exit could strand retained session ownership. Authenticated bridge process identity and fresh shared process observations now distinguish confirmed exit from a live application with lost transport, retaining resources when cleanup is unresolved.
Validation: Hopper external-exit recovery and live/lost-transport negative controls. No real Hopper GUI engine was launched. Full exact-revision qualification passed.