[PR #116] [MERGED] fix(hopper): complete owned Linux shutdown #1842

Closed
opened 2026-10-16 21:11:41 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/116
Author: @morluto
Created: 7/13/2026
Status: ✅ Merged
Merged: 7/13/2026
Merged by: @morluto

Base: main ← Head: fix/hopper-owned-shutdown


📝 Commits (2)

  • d28336c fix(hopper): avoid blocking owned Linux shutdown
  • 02fe120 fix(hopper): complete owned shutdown cleanup

📊 Changes

4 files changed (+74 additions, -13 deletions)

View changed files

📝 bridge/hopper_bridge.py (+12 -3)
📝 src/hopper/BridgeLauncher.ts (+11 -5)
📝 src/hopper/HopperClient.ts (+44 -5)
📝 tests/bridgeTruthfulness.test.ts (+7 -0)

📄 Description

Description

Linux real-Hopper verification completed analysis but hung for 30 seconds in waitForBackgroundProcessToEnd() during shutdown. The timeout produced an error diagnostic even though REA owns the Linux demo Hopper process group and can close it through the existing run-token-verified cleanup path.

This change distinguishes two shutdown paths:

  • owned Linux demo sessions acknowledge that process cleanup is required, then keep the bridge socket available while the client performs verified process-group cleanup;
  • non-owned sessions retain Hopper's document stop, wait, and close sequence.

If owned cleanup fails, the client requests a bounded document-shutdown fallback and retries cleanup. Cleanup still fails closed when process identity cannot be proven.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Refactoring (no functional change)
  • Tool contract change (MCP schema modification)

Testing Performed

  • Unit tests added or updated
  • TypeScript typecheck passes (npm run typecheck)
  • Linting passes (npm run lint)
  • Full test suite passes (npm test via npm run check): 67 files, 479 tests
  • Real Hopper verification performed (npm run verify:hopper): macOS was not available
  • Linux real Hopper verification performed (npm run verify:hopper:linux)
  • Package verification performed (npm run verify:package)

Additional proof:

  • HOPPER_LAUNCHER_PATH=/opt/hopper/bin/Hopper HOPPER_TARGET_PATH=/bin/true HOPPER_SECOND_TARGET_PATH=/bin/ls npm run verify:hopper:linux passed with 68 tools, two distinct target hashes, semantic decompilation and dossier checks, target switching, and cleanShutdown: true.
  • HOPPER_LAUNCHER_PATH=/opt/hopper/bin/Hopper node scripts/rea.mjs analyze --format md /bin/true returned a binary_overview Evidence record instead of calling an unknown bridge method.
  • npm run verify:package passed the packaged CLI, setup, 68-tool MCP server, six prompts, and target lifecycle.
  • npm pack --dry-run listed 179 package files.
  • Final structured autoreview reported no accepted or actionable findings.

Tool Contract Impact

None. The 68-tool inventory and public CLI/MCP schemas are unchanged. The new shutdown messages are private to REA's authenticated Hopper bridge.

Suggested Review Order

  1. bridge/hopper_bridge.py
  2. src/hopper/HopperClient.ts and src/hopper/BridgeLauncher.ts
  3. tests/bridgeTruthfulness.test.ts

Closes #16.
Closes #56.


🔄 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/116 **Author:** [@morluto](https://github.com/morluto) **Created:** 7/13/2026 **Status:** ✅ Merged **Merged:** 7/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/hopper-owned-shutdown` --- ### 📝 Commits (2) - [`d28336c`](https://github.com/morluto/rea/commit/d28336c6e5b24c2b2b776c43b747df793a19c56d) fix(hopper): avoid blocking owned Linux shutdown - [`02fe120`](https://github.com/morluto/rea/commit/02fe1205230d36ea2a15c367ea6f28a8709b3afe) fix(hopper): complete owned shutdown cleanup ### 📊 Changes **4 files changed** (+74 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `bridge/hopper_bridge.py` (+12 -3) 📝 `src/hopper/BridgeLauncher.ts` (+11 -5) 📝 `src/hopper/HopperClient.ts` (+44 -5) 📝 `tests/bridgeTruthfulness.test.ts` (+7 -0) </details> ### 📄 Description ## Description Linux real-Hopper verification completed analysis but hung for 30 seconds in `waitForBackgroundProcessToEnd()` during shutdown. The timeout produced an error diagnostic even though REA owns the Linux demo Hopper process group and can close it through the existing run-token-verified cleanup path. This change distinguishes two shutdown paths: - owned Linux demo sessions acknowledge that process cleanup is required, then keep the bridge socket available while the client performs verified process-group cleanup; - non-owned sessions retain Hopper's document stop, wait, and close sequence. If owned cleanup fails, the client requests a bounded document-shutdown fallback and retries cleanup. Cleanup still fails closed when process identity cannot be proven. ## Type of Change - [x] Bug fix - [ ] New feature - [ ] Documentation update - [ ] Performance improvement - [ ] Refactoring (no functional change) - [ ] Tool contract change (MCP schema modification) ## Testing Performed - [x] Unit tests added or updated - [x] TypeScript typecheck passes (`npm run typecheck`) - [x] Linting passes (`npm run lint`) - [x] Full test suite passes (`npm test` via `npm run check`): 67 files, 479 tests - [ ] Real Hopper verification performed (`npm run verify:hopper`): macOS was not available - [x] Linux real Hopper verification performed (`npm run verify:hopper:linux`) - [x] Package verification performed (`npm run verify:package`) Additional proof: - `HOPPER_LAUNCHER_PATH=/opt/hopper/bin/Hopper HOPPER_TARGET_PATH=/bin/true HOPPER_SECOND_TARGET_PATH=/bin/ls npm run verify:hopper:linux` passed with 68 tools, two distinct target hashes, semantic decompilation and dossier checks, target switching, and `cleanShutdown: true`. - `HOPPER_LAUNCHER_PATH=/opt/hopper/bin/Hopper node scripts/rea.mjs analyze --format md /bin/true` returned a `binary_overview` Evidence record instead of calling an unknown bridge method. - `npm run verify:package` passed the packaged CLI, setup, 68-tool MCP server, six prompts, and target lifecycle. - `npm pack --dry-run` listed 179 package files. - Final structured autoreview reported no accepted or actionable findings. ## Tool Contract Impact None. The 68-tool inventory and public CLI/MCP schemas are unchanged. The new shutdown messages are private to REA's authenticated Hopper bridge. ## Suggested Review Order 1. `bridge/hopper_bridge.py` 2. `src/hopper/HopperClient.ts` and `src/hopper/BridgeLauncher.ts` 3. `tests/bridgeTruthfulness.test.ts` ## Related Issues Closes #16. Closes #56. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:11:41 +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#1842
No description provided.