[PR #1044] [MERGED] fix(hopper): diagnose MCP provider failures with stage, state, and request context #2603

Closed
opened 2026-10-17 21:08:06 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1044
Author: @ALANDVO
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @N0zoM1z0

Base: main ← Head: portfolio/alan/cc70962319b4


📝 Commits (5)

  • cc70962 fix(hopper): diagnose MCP provider failures with stage, state, and request context
  • 5636548 chore: merge main into Hopper diagnostics repair
  • 9ad5691 fix(hopper): retain health at the actual provider lifecycle boundary
  • 12fe430 test(hopper): distinguish socket loss from later observed process exit
  • 8a2cc09 test(hopper): cover observed exit separately from socket-first replies

📊 Changes

20 files changed (+990 additions, -62 deletions)

View changed files

📝 scripts/verify-real-hopper.mjs (+6 -1)
📝 src/application/AnalysisProvider.ts (+3 -0)
📝 src/application/binary/BinarySession.ts (+2 -0)
📝 src/application/binary/BinarySessionStatus.ts (+23 -0)
📝 src/application/binary/CompositeProvider.ts (+12 -0)
📝 src/application/binary/LazyAnalysisProvider.ts (+5 -0)
📝 src/contracts/toolOutputSchemaPrimitives.ts (+22 -0)
📝 src/domain/analysisErrorPresentation.ts (+37 -3)
📝 src/domain/analysisErrorProjection.test.ts (+37 -0)
📝 src/domain/analysisErrorProjection.ts (+22 -3)
📝 src/domain/hopperErrors.ts (+20 -0)
➕ src/domain/providerOperationHealth.ts (+88 -0)
📝 src/hopper/HopperClient.ts (+254 -6)
➕ src/hopper/HopperOperationStage.ts (+9 -0)
📝 src/hopper/HopperProvider.ts (+1 -0)
📝 src/hopper/HopperRequestQueue.ts (+41 -27)
➕ tests/boundary/providers/hopper/hopperClient.health.test.ts (+178 -0)
📝 tests/boundary/providers/hopper/hopperClient.protocol.test.ts (+126 -0)
📝 tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts (+34 -22)
📝 tests/composition/analysis-sessions/binarySession.test.ts (+70 -0)

📄 Description

Hopper failures now preserve the operation/request ID, observed provider state, and actionable recovery in CLI/MCP errors and binary_session.provider_operation_health (refs #478).

Maintainer follow-up fixes three reproduced lifecycle regressions: a non-owning macOS launcher helper exiting does not mean the GUI exited; socket loss after helper exit settles pending requests as unreachable with no invented GUI exit code; an earlier successful reply cannot erase a subsequently observed provider exit. New startup attempts reset retained health, and startup timeout remains visible. Hopper wire-method stage classification stays in the Hopper adapter; the existing startup-timeout stage: "startup" value is preserved. Obsolete generated snapshots were removed during main integration.

Example failure details: {"stage":"analysis","provider_state":"exited","retry_action":"restart_provider","operation":"search_strings","request_id":4,"exit_code":7}.

Validation at 9ad56910:

  • 105 focused tests, including three regressions demonstrated failing before the follow-up; advertised MCP JSON Schema validation passed.
  • npm run check:fast and npm run docs:check passed.
  • Unmodified scripts/verify-real-hopper-linux.mjs passed against official pinned Hopper 6.4.2 demo in an isolated Ubuntu 24 container (1 CPU, 1536 MiB hard memory limit). Real semantic analysis, target switching, complete large inventories, process lineage, unrelated-process survival, and clean shutdown passed.

Native macOS GUI verification was not performed locally; Linux proof and deterministic helper-handoff tests do not establish macOS overlay/window behavior. A separately confirmed binary_overview document-name attribution bug will receive its own bounded fix. No Ghidra behavior changed or new Ghidra verification claimed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1044 **Author:** [@ALANDVO](https://github.com/ALANDVO) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `portfolio/alan/cc70962319b4` --- ### 📝 Commits (5) - [`cc70962`](https://github.com/morluto/rea/commit/cc70962319b428c6bffe472591b4f192bb9d75e1) fix(hopper): diagnose MCP provider failures with stage, state, and request context - [`5636548`](https://github.com/morluto/rea/commit/563654870b00055783b4f91778e4295c510c80b7) chore: merge main into Hopper diagnostics repair - [`9ad5691`](https://github.com/morluto/rea/commit/9ad569105f5d4d3efd16d0698a16861e35b766ab) fix(hopper): retain health at the actual provider lifecycle boundary - [`12fe430`](https://github.com/morluto/rea/commit/12fe430ce6b2c24e58bd1c6cf20263a49c2c19e2) test(hopper): distinguish socket loss from later observed process exit - [`8a2cc09`](https://github.com/morluto/rea/commit/8a2cc094804f3dacc90e77b0b782d87187f149b8) test(hopper): cover observed exit separately from socket-first replies ### 📊 Changes **20 files changed** (+990 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-real-hopper.mjs` (+6 -1) 📝 `src/application/AnalysisProvider.ts` (+3 -0) 📝 `src/application/binary/BinarySession.ts` (+2 -0) 📝 `src/application/binary/BinarySessionStatus.ts` (+23 -0) 📝 `src/application/binary/CompositeProvider.ts` (+12 -0) 📝 `src/application/binary/LazyAnalysisProvider.ts` (+5 -0) 📝 `src/contracts/toolOutputSchemaPrimitives.ts` (+22 -0) 📝 `src/domain/analysisErrorPresentation.ts` (+37 -3) 📝 `src/domain/analysisErrorProjection.test.ts` (+37 -0) 📝 `src/domain/analysisErrorProjection.ts` (+22 -3) 📝 `src/domain/hopperErrors.ts` (+20 -0) ➕ `src/domain/providerOperationHealth.ts` (+88 -0) 📝 `src/hopper/HopperClient.ts` (+254 -6) ➕ `src/hopper/HopperOperationStage.ts` (+9 -0) 📝 `src/hopper/HopperProvider.ts` (+1 -0) 📝 `src/hopper/HopperRequestQueue.ts` (+41 -27) ➕ `tests/boundary/providers/hopper/hopperClient.health.test.ts` (+178 -0) 📝 `tests/boundary/providers/hopper/hopperClient.protocol.test.ts` (+126 -0) 📝 `tests/boundary/providers/hopper/hopperClient.startupFailures.test.ts` (+34 -22) 📝 `tests/composition/analysis-sessions/binarySession.test.ts` (+70 -0) </details> ### 📄 Description Hopper failures now preserve the operation/request ID, observed provider state, and actionable recovery in CLI/MCP errors and `binary_session.provider_operation_health` (refs #478). Maintainer follow-up fixes three reproduced lifecycle regressions: a non-owning macOS launcher helper exiting does not mean the GUI exited; socket loss after helper exit settles pending requests as unreachable with no invented GUI exit code; an earlier successful reply cannot erase a subsequently observed provider exit. New startup attempts reset retained health, and startup timeout remains visible. Hopper wire-method stage classification stays in the Hopper adapter; the existing startup-timeout `stage: "startup"` value is preserved. Obsolete generated snapshots were removed during main integration. Example failure details: `{"stage":"analysis","provider_state":"exited","retry_action":"restart_provider","operation":"search_strings","request_id":4,"exit_code":7}`. Validation at `9ad56910`: - 105 focused tests, including three regressions demonstrated failing before the follow-up; advertised MCP JSON Schema validation passed. - `npm run check:fast` and `npm run docs:check` passed. - Unmodified `scripts/verify-real-hopper-linux.mjs` passed against official pinned Hopper 6.4.2 demo in an isolated Ubuntu 24 container (1 CPU, 1536 MiB hard memory limit). Real semantic analysis, target switching, complete large inventories, process lineage, unrelated-process survival, and clean shutdown passed. Native macOS GUI verification was not performed locally; Linux proof and deterministic helper-handoff tests do not establish macOS overlay/window behavior. A separately confirmed `binary_overview` document-name attribution bug will receive its own bounded fix. No Ghidra behavior changed or new Ghidra verification claimed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:06 +00:00
Sign in to join this conversation.
No milestone
No project
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#2603
No description provided.