[PR #4966] [MERGED] fix(hopper): shut down the Linux demo helper orderly so its X lock is removed #6699

Closed
opened 2026-11-01 21:42:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4966
Author: @sx4im
Created: 10/18/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @morluto

Base: main ← Head: fix/4921-hopper-stale-x11-lock


📝 Commits (2)

  • ccff3fe fix(hopper): shut down the Linux demo helper orderly so its X lock is removed
  • 419657a fix(hopper): notice signal-exited demo helpers during orderly shutdown

📊 Changes

3 files changed (+338 additions, -1 deletions)

View changed files

📝 src/hopper/BridgeLauncher.ts (+78 -1)
📝 tests/boundary/providers/hopper/bridgeLauncher.test.ts (+214 -0)
➕ tests/fixtures/hopperOrderlyShutdown.py (+46 -0)

📄 Description

Summary

Fixes #4921. On the Linux demo launch path, close the helper's stdin before falling back to process-group termination. This lets its existing OwnerLifetime shutdown path stop Hopper/Xvfb orderly so Xvfb can remove its own lock.

The launcher waits for orderly exit for the configured grace period, then uses the existing token-verified fallback kill. It checks both exitCode and signalCode before waiting, so a child that already exited by signal cannot cause an unnecessary grace-period wait. No new process authority is introduced.

Validation

The final diff adds three tests in bridgeLauncher.test.ts and an authored orderly-shutdown helper fixture. This pass ran the focused bridge-launcher suite on Node 24.18.0/npm 11.16.0: 9 passed, 5 skipped. The duplicate exit-listener finding is already addressed by the current pre-wait exit/signal checks; no further source change was needed.

These fixtures exercise the production launcher cleanup boundary and helper lifetime protocol. They do not establish end-to-end lock removal with a real Hopper/Xvfb installation; that provider coverage remains unavailable on this host.

Author readiness

Human owner: @sx4im

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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.

🔄 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/4966 **Author:** [@sx4im](https://github.com/sx4im) **Created:** 10/18/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/4921-hopper-stale-x11-lock` --- ### 📝 Commits (2) - [`ccff3fe`](https://github.com/morluto/rea/commit/ccff3fe2e581a33e5305295a6426dccb662538bb) fix(hopper): shut down the Linux demo helper orderly so its X lock is removed - [`419657a`](https://github.com/morluto/rea/commit/419657a49a0eb445eedc9476eaae4c475cb9af08) fix(hopper): notice signal-exited demo helpers during orderly shutdown ### 📊 Changes **3 files changed** (+338 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/hopper/BridgeLauncher.ts` (+78 -1) 📝 `tests/boundary/providers/hopper/bridgeLauncher.test.ts` (+214 -0) ➕ `tests/fixtures/hopperOrderlyShutdown.py` (+46 -0) </details> ### 📄 Description ## Summary Fixes #4921. On the Linux demo launch path, close the helper's stdin before falling back to process-group termination. This lets its existing `OwnerLifetime` shutdown path stop Hopper/Xvfb orderly so Xvfb can remove its own lock. The launcher waits for orderly exit for the configured grace period, then uses the existing token-verified fallback kill. It checks both `exitCode` and `signalCode` before waiting, so a child that already exited by signal cannot cause an unnecessary grace-period wait. No new process authority is introduced. ## Validation The final diff adds three tests in `bridgeLauncher.test.ts` and an authored orderly-shutdown helper fixture. This pass ran the focused bridge-launcher suite on Node 24.18.0/npm 11.16.0: 9 passed, 5 skipped. The duplicate exit-listener finding is already addressed by the current pre-wait exit/signal checks; no further source change was needed. These fixtures exercise the production launcher cleanup boundary and helper lifetime protocol. They do not establish end-to-end lock removal with a real Hopper/Xvfb installation; that provider coverage remains unavailable on this host. ## Author readiness <!-- The human owner completes these declarations before requesting review. The PR author is the owner by default. A different owner must explicitly accept ownership on this PR. AI agents must leave these declarations to a human to dictate to them or there could be catastrophic consequences for many users of REA. Draft PRs may leave them unchecked. These declarations record initial readiness when opening the PR for review; later pushes do not require a new human sign-off. Keep the description and validation evidence current as the work changes. See CONTRIBUTING.md#pull-request-ownership-and-readiness. --> Human owner: @sx4im - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge <!-- Draft PRs may leave pending items unchecked. Resolve material scope and authority questions before integration. --> - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:42:23 +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#6699
No description provided.