[PR #110] [MERGED] fix(linux): start Hopper demo sessions headlessly #1841

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/110
Author: @morluto
Created: 7/13/2026
Status: ✅ Merged
Merged: 7/13/2026
Merged by: @morluto

Base: main ← Head: fix/linux-hopper-demo


📝 Commits (4)

  • 75818d1 fix(linux): start Hopper demo sessions headlessly
  • 67504d2 test(linux): verify setup through CLI and MCP
  • 977119f test(package): preserve unsupported host verification
  • c5728af fix(ci): remove unused setup type export

📊 Changes

26 files changed (+1372 additions, -220 deletions)

View changed files

📝 .github/workflows/real-hopper-linux.yml (+21 -0)
📝 CONTRIBUTING.md (+2 -2)
📝 README.md (+5 -5)
📝 package.json (+2 -0)
➕ scripts/hopper-demo-x11.py (+349 -0)
➕ scripts/verify-linux-setup-e2e.mjs (+122 -0)
📝 scripts/verify-package.mjs (+5 -4)
📝 scripts/verify-real-hopper-linux.mjs (+3 -7)
📝 src/application/Doctor.ts (+50 -0)
📝 src/application/LinuxHopper.ts (+105 -61)
📝 src/application/Setup.ts (+48 -60)
➕ src/application/SetupInstallFailure.ts (+95 -0)
➕ src/application/SetupPlan.ts (+41 -0)
📝 src/contracts/toolOutputSchemas.ts (+14 -0)
📝 src/domain/errors.ts (+16 -0)
➕ src/domain/hopperStartupFailure.ts (+73 -0)
📝 src/hopper/BridgeLauncher.ts (+69 -21)
📝 src/hopper/HopperClient.ts (+9 -0)
📝 src/hopper/HopperProvider.ts (+3 -0)
📝 tests/doctor.test.ts (+49 -0)

...and 6 more files

📄 Description

Description

Linux Hopper 6.4.2 presents Try the Demo on every cold process and blocks the REA Python bridge before CLI or MCP analysis can start. This change makes that startup path work without a desktop session or a persistent Hopper process.

REA now launches each Linux Hopper session on an authenticated private Xvfb display, validates the exact supported Hopper binary and dialog rectangle, selects only the expected demo action, waits for the authenticated bridge handshake, and tears down Hopper and Xvfb with the session. Licensed installations continue when the bridge appears without a demo dialog. Any binary, dialog, process, or startup mismatch fails closed with a caller-safe error.

Setup now installs the direct Xvfb, xauth, Python, X11, and XTEST runtime packages, pins the official Hopper 6.4.2 Linux artifacts, and reports unsupported configured launchers instead of repeatedly reinstalling the system package. Doctor checks the same runtime and binary contracts. Fresh macOS installs still require first-run activation.

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)
  • 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_TARGET_PATH=/usr/bin/true HOPPER_SECOND_TARGET_PATH=/usr/bin/false npm run verify:hopper:linux passed with 68 tools, target switching, and clean shutdown.
  • The same Linux verifier passed while the parent environment advertised Wayland, proving the helper forced Hopper onto its private X11 display.
  • npm pack --dry-run --json included scripts/hopper-demo-x11.py.
  • npm run knip, npm run jscpd, and npm run scan:todos completed; jscpd reported 1.49% duplicated lines.
  • Final structured autoreview reported no accepted or actionable findings.

Real runtime verification used Ubuntu 24.04 and Hopper 6.4.2. Fedora and Arch package commands are covered by tests but were not exercised on real hosts. Supporting another Hopper version requires validating its real dialog layout and adding its binary and package digests.

Tool Contract Impact

None. The 68-tool inventory and MCP schemas are unchanged. CLI and MCP share the same Hopper launch boundary.

Suggested Review Order

  1. scripts/hopper-demo-x11.py and src/hopper/BridgeLauncher.ts
  2. src/application/LinuxHopper.ts, src/application/Doctor.ts, and src/application/Setup.ts
  3. src/hopper/HopperClient.ts and src/domain/errors.ts
  4. Tests and package/real-Hopper verifiers

No directly related issue or PR was found.

Disclosure

This change was developed with AI assistance. The implementation was exercised against real Hopper on Linux, audited through the repository review gates, and the final diff passed structured review.


🔄 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/110 **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/linux-hopper-demo` --- ### 📝 Commits (4) - [`75818d1`](https://github.com/morluto/rea/commit/75818d119e3eb3b8df5acdbd554a2b86b82af23a) fix(linux): start Hopper demo sessions headlessly - [`67504d2`](https://github.com/morluto/rea/commit/67504d2d51151fd9eed76b12c9bae67c70817432) test(linux): verify setup through CLI and MCP - [`977119f`](https://github.com/morluto/rea/commit/977119f91b4af39ea208a5e63d9445bf366b2eeb) test(package): preserve unsupported host verification - [`c5728af`](https://github.com/morluto/rea/commit/c5728af0b4574631d056f7ed1eb7785e80d80111) fix(ci): remove unused setup type export ### 📊 Changes **26 files changed** (+1372 additions, -220 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/real-hopper-linux.yml` (+21 -0) 📝 `CONTRIBUTING.md` (+2 -2) 📝 `README.md` (+5 -5) 📝 `package.json` (+2 -0) ➕ `scripts/hopper-demo-x11.py` (+349 -0) ➕ `scripts/verify-linux-setup-e2e.mjs` (+122 -0) 📝 `scripts/verify-package.mjs` (+5 -4) 📝 `scripts/verify-real-hopper-linux.mjs` (+3 -7) 📝 `src/application/Doctor.ts` (+50 -0) 📝 `src/application/LinuxHopper.ts` (+105 -61) 📝 `src/application/Setup.ts` (+48 -60) ➕ `src/application/SetupInstallFailure.ts` (+95 -0) ➕ `src/application/SetupPlan.ts` (+41 -0) 📝 `src/contracts/toolOutputSchemas.ts` (+14 -0) 📝 `src/domain/errors.ts` (+16 -0) ➕ `src/domain/hopperStartupFailure.ts` (+73 -0) 📝 `src/hopper/BridgeLauncher.ts` (+69 -21) 📝 `src/hopper/HopperClient.ts` (+9 -0) 📝 `src/hopper/HopperProvider.ts` (+3 -0) 📝 `tests/doctor.test.ts` (+49 -0) _...and 6 more files_ </details> ### 📄 Description ## Description Linux Hopper 6.4.2 presents `Try the Demo` on every cold process and blocks the REA Python bridge before CLI or MCP analysis can start. This change makes that startup path work without a desktop session or a persistent Hopper process. REA now launches each Linux Hopper session on an authenticated private Xvfb display, validates the exact supported Hopper binary and dialog rectangle, selects only the expected demo action, waits for the authenticated bridge handshake, and tears down Hopper and Xvfb with the session. Licensed installations continue when the bridge appears without a demo dialog. Any binary, dialog, process, or startup mismatch fails closed with a caller-safe error. Setup now installs the direct Xvfb, xauth, Python, X11, and XTEST runtime packages, pins the official Hopper 6.4.2 Linux artifacts, and reports unsupported configured launchers instead of repeatedly reinstalling the system package. Doctor checks the same runtime and binary contracts. Fresh macOS installs still require first-run activation. ## Type of Change - [x] Bug fix - [ ] New feature - [x] 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`) - [ ] 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_TARGET_PATH=/usr/bin/true HOPPER_SECOND_TARGET_PATH=/usr/bin/false npm run verify:hopper:linux` passed with 68 tools, target switching, and clean shutdown. - The same Linux verifier passed while the parent environment advertised Wayland, proving the helper forced Hopper onto its private X11 display. - `npm pack --dry-run --json` included `scripts/hopper-demo-x11.py`. - `npm run knip`, `npm run jscpd`, and `npm run scan:todos` completed; jscpd reported 1.49% duplicated lines. - Final structured autoreview reported no accepted or actionable findings. Real runtime verification used Ubuntu 24.04 and Hopper 6.4.2. Fedora and Arch package commands are covered by tests but were not exercised on real hosts. Supporting another Hopper version requires validating its real dialog layout and adding its binary and package digests. ## Tool Contract Impact None. The 68-tool inventory and MCP schemas are unchanged. CLI and MCP share the same Hopper launch boundary. ## Suggested Review Order 1. `scripts/hopper-demo-x11.py` and `src/hopper/BridgeLauncher.ts` 2. `src/application/LinuxHopper.ts`, `src/application/Doctor.ts`, and `src/application/Setup.ts` 3. `src/hopper/HopperClient.ts` and `src/domain/errors.ts` 4. Tests and package/real-Hopper verifiers ## Related Issues No directly related issue or PR was found. ## Disclosure This change was developed with AI assistance. The implementation was exercised against real Hopper on Linux, audited through the repository review gates, and the final diff passed structured review. --- <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#1841
No description provided.