Skip to content

fix(hopper): preserve observed process failures across requests - #1927

Merged
morluto merged 3 commits into
mainfrom
codex/refactor-boundary-ownership
Oct 11, 2026
Merged

morluto merged 3 commits into
mainfrom
codex/refactor-boundary-ownership

Conversation

@morluto

@morluto morluto commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

When an owned Hopper process stopped during a request, queue enrichment dropped its launcher diagnostics, and later requests reduced the observed exit to an unreachable socket. Preserve the exit code or signal, bounded output, and output-closure uncertainty for active, queued, and later callers. Related to #1808; that issue remains open because external GUI crash recovery is a separate ownership problem.

Problem and expected behavior

A signal exit has no numeric exit code. Callers should still receive the observed signal and an exited provider state, with their own operation and request ID. A native GUI helper's exit must remain distinct from an observed GUI exit.

Change and scope

Use named error context instead of seven positional arguments, preserve typed diagnostic context when correlating queued requests, and retain owned-process exit facts at the request boundary. Document the resulting diagnostics, the macOS first-use demo/license prompt, and pending-dialog troubleshooting in the README and installation guide.

Consolidate redundant external-document cleanup tests and recover failed helper fixtures through their exact authenticated bridge during teardown. This removes repeated 30-second cleanup waits while retaining negative acknowledgement, missing transport, backing-image retention, helper ownership, and cleanup retry coverage.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Hopper process supervision and request correlation.
  • CLI and MCP/tool-catalog contract: additive details.launcher evidence on owned runtime failures; signal-aware failure messages; no catalog changes.
  • Provider, bridge, target-format, or platform compatibility: shared Hopper client; native GUI helper exits remain unknown GUI lifetime.
  • Evidence, artifact, provenance, or reconstruction contract: retain observed exit/output and per-request identity; preserve explicit stream-closure uncertainty.
  • Process execution, authorization, cleanup, or containment impact: no new process authority; tests use authenticated cleanup instead of assuming an external GUI exited with its helper.
  • Generated metadata, package, or installation impact: none; installation documentation explains diagnostics.

Evidence and regression coverage

  • Tests added or updated: numeric exit evidence; active/queued/later signal failure correlation; exact transport credential redaction while preserving source-looking values; disconnected external bridge recovery; consolidated cleanup ownership and retained resources.

  • Base reproduction: the numeric exit regression failed on the affected base because details.launcher was absent.

  • User-visible CLI/MCP output: provider_unavailable, provider_state: exited, observed signal in the message and details.launcher, operation-specific stage/request identity.

  • Remaining proof gaps: no real native GUI crash was induced. Native helper lifetime does not prove GUI lifetime.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check — passed, including typecheck, lint, formatting, dependency/metadata checks and architecture guards.
  • Selected domain, request queue, cleanup, Hopper lifecycle/protocol/startup/launcher and MCP boundary tests — 152 tests in 13 files passed in 9.47 seconds.
  • npm run docs:check and npm run build:cached — passed.
  • npm run verify:fixtures — seven source-owned macOS fixtures passed.
  • node scripts/verify-real-hopper.mjs — passed against installed Hopper 6.6.0-demo after the user accepted its demo prompt: 199 successful boundary calls, 62 rejected calls, 172 schemas, complete 1,205-item procedure/string inventories, timeout/cancellation recovery, target switching and CLI/MCP parity. Native document closure, unrelated-process survival and empty owned descendant lineage verified.
  • The first cold startup failed with helper exit 2 (Cannot launch Hopper! Connection is invalid.); REA preserved its diagnostics and retained unconfirmed resources. The successful subsequent run does not erase that failed attempt.

Compatibility, safety, and release

  • Breaking changes or migration steps: none for CLI/MCP callers; internal constructor call sites migrated together.
  • Real Hopper/Ghidra, browser, or OS coverage: real macOS arm64 Hopper exercised above; other providers unchanged.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: bounded output retains local evidence and redacts only the transport credential; no GUI termination or unrelated-document cleanup authority added.

Review checklist

  • This PR addresses a concrete problem or an agreed enhancement.
  • 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-11T18:09:21.989794Z 814877e PR opened
ℹ️ 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.

@morluto
morluto merged commit 601814e into main Oct 11, 2026
29 checks passed
@morluto
morluto deleted the codex/refactor-boundary-ownership branch October 11, 2026 18:13
@github-actions github-actions Bot mentioned this pull request Oct 11, 2026
3 tasks done
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant