[PR #2969] fix(hopper): support WSLg socket symlinks for private displays #5527

Open
opened 2026-10-31 01:07:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2969
Author: @idanhom
Created: 10/13/2026
Status: 🔄 Open

Base: main ← Head: fix/wslg-hopper-private-display


📝 Commits (1)

  • 5462793 fix(hopper): support WSLg socket symlinks for private displays

📊 Changes

3 files changed (+77 additions, -4 deletions)

View changed files

📝 docs/installation.md (+4 -1)
📝 scripts/hopper-demo-x11.py (+23 -3)
📝 tests/boundary/providers/hopper/linuxPrivateDisplay.test.ts (+50 -0)

📄 Description

Summary

Fix Hopper's private Xvfb display startup when WSLg exposes /tmp/.X11-unix as a symlink. The helper uses authenticated Linux abstract Unix sockets for this layout, leaving WSLg's shared directory unchanged.

Problem and expected behavior

On Fedora 43 under WSLg, rea doctor --provider hopper reports x11_socket_directory_unusable with namespace_unavailable and mount_validation_failed, even though user and mount namespaces work. The helper combines lstat() facts about the symlink with statvfs() facts about its target. Following the target fixes that inconsistency, but Xvfb's filesystem listener also rejects the symlink.

The expected behavior is to start REA's private display without changing the host's WSLg socket directory. No issue is linked; this was reproduced while troubleshooting an installed REA instance.

Change and scope

  • Inspect the resolved directory consistently with stat() and statvfs().
  • For a symlink socket directory, disable Xvfb's filesystem listener and probe its Linux abstract Unix socket with a bounded connection attempt. Retain Xauthority authentication and disabled TCP listening.
  • Preserve the existing filesystem listener and private mount fallback for other layouts.
  • Document the WSLg path and cover resolved directory facts, unusable targets, and abstract/filesystem socket readiness.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Linux private-display Python helper, at directory inspection and Xvfb startup.
  • Contribution scope fit and linked maintainer decision: routine fix to the existing Hopper display lifecycle; a new capability scope decision is not applicable.
  • CLI and MCP/tool-catalog contract: no schema changes; doctor can report the existing direct strategy as ready on this WSLg layout.
  • Provider/platform compatibility: Linux Hopper; real display checks performed on Fedora 43 under WSLg. Other distributions remain unverified.
  • Evidence/artifact/provenance contract: diagnostics report resolved directory facts; no target Evidence changes.
  • Target selection/authority/cleanup: target selection and Hopper execution authority are unchanged. Existing Xvfb process ownership and cleanup remain in use.
  • Generated metadata/package/installation impact: shipped Python helper and installation documentation change; no generated catalog or setup configuration changes in this PR.

Expected effects of the affected runtime workflow:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code (existing Python display helper).
  • Change process memory, registers, files, or configuration (existing temporary Xauthority files and sockets).
  • Network services: no TCP listener; the readiness probe connects to a local Unix socket.
  • Protection recovery: none introduced.

Evidence and regression coverage

  • Added coverage in linuxPrivateDisplay.test.ts for symlink target permissions/type, dangling targets, and abstract versus filesystem socket readiness.
  • Base reproduction: the installed helper fails with mount_validation_failed; changing only directory inspection exposes Xvfb's filesystem-listener failure.
  • Executed a real Xvfb probe and authenticated XOpenDisplay connection using the changed helper.
  • Executed the embedded Python regression directly, plus existing dialog, bounded cleanup, and owner-lifetime fixtures for startup and ready phases; all passed.
  • Patched the installed helper with only the display changes and verified doctor reports healthy: true for Hopper. Integration setup was repaired separately and is outside this diff.
  • Remaining proof gaps: the TypeScript/Vitest harness and full repository checks have not run because checkout dependencies and the pinned development toolchain are absent. No end-to-end Hopper target analysis was run. Whole-task performance metrics were not measured.

Validation performed

  • python3 scripts/hopper-demo-x11.py --probe --strategy direct — ready on WSLg, outside the execution sandbox.
  • Python regression, real authenticated X11 connection, and existing Python boundary fixtures — passed outside the execution sandbox.
  • rea doctor --provider hopper --client claude_code --client codex --client cursor --client pi --skill --format json --filter-output healthy,environment_healthy,scope,scope_checks,informational_checks — healthy: true, environment_healthy: true after the separate approved setup refresh.
  • git diff --check — passed.

Compatibility, safety, and release

  • No intended breaking changes or migration.
  • Real-provider coverage is limited to Xvfb/X11 and Hopper doctor readiness; full Hopper analysis and non-WSLg Linux remain unverified.
  • No release metadata changes.
  • TCP remains disabled, Xauthority is retained, and host WSLg files/mounts are unchanged. Abstract sockets share the existing Linux network namespace, as with Xvfb's existing local transport.

Before merge

  • This PR addresses a concrete problem and has a focused Conventional Commit title.
  • Owning documentation is updated and representative doctor results are recorded.
  • Final diff excludes the local diagnostic output and configuration changes.
  • Run required repository checks with the pinned toolchain.
  • Verify an end-to-end Hopper analysis and ordinary Linux display behavior.
  • Complete maintainer review of transport readiness, authentication, and cleanup coverage.

🔄 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/2969 **Author:** [@idanhom](https://github.com/idanhom) **Created:** 10/13/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/wslg-hopper-private-display` --- ### 📝 Commits (1) - [`5462793`](https://github.com/morluto/rea/commit/5462793be031d1e1fe1a2bdd5240610700d5d8b8) fix(hopper): support WSLg socket symlinks for private displays ### 📊 Changes **3 files changed** (+77 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/installation.md` (+4 -1) 📝 `scripts/hopper-demo-x11.py` (+23 -3) 📝 `tests/boundary/providers/hopper/linuxPrivateDisplay.test.ts` (+50 -0) </details> ### 📄 Description ## Summary Fix Hopper's private Xvfb display startup when WSLg exposes `/tmp/.X11-unix` as a symlink. The helper uses authenticated Linux abstract Unix sockets for this layout, leaving WSLg's shared directory unchanged. ## Problem and expected behavior On Fedora 43 under WSLg, `rea doctor --provider hopper` reports `x11_socket_directory_unusable` with `namespace_unavailable` and `mount_validation_failed`, even though user and mount namespaces work. The helper combines `lstat()` facts about the symlink with `statvfs()` facts about its target. Following the target fixes that inconsistency, but Xvfb's filesystem listener also rejects the symlink. The expected behavior is to start REA's private display without changing the host's WSLg socket directory. No issue is linked; this was reproduced while troubleshooting an installed REA instance. ## Change and scope - Inspect the resolved directory consistently with `stat()` and `statvfs()`. - For a symlink socket directory, disable Xvfb's filesystem listener and probe its Linux abstract Unix socket with a bounded connection attempt. Retain Xauthority authentication and disabled TCP listening. - Preserve the existing filesystem listener and private mount fallback for other layouts. - Document the WSLg path and cover resolved directory facts, unusable targets, and abstract/filesystem socket readiness. ## Contract and boundary impact - Semantic owner and earliest changed stage: Linux private-display Python helper, at directory inspection and Xvfb startup. - Contribution scope fit and linked maintainer decision: routine fix to the existing Hopper display lifecycle; a new capability scope decision is not applicable. - CLI and MCP/tool-catalog contract: no schema changes; doctor can report the existing `direct` strategy as ready on this WSLg layout. - Provider/platform compatibility: Linux Hopper; real display checks performed on Fedora 43 under WSLg. Other distributions remain unverified. - Evidence/artifact/provenance contract: diagnostics report resolved directory facts; no target Evidence changes. - Target selection/authority/cleanup: target selection and Hopper execution authority are unchanged. Existing Xvfb process ownership and cleanup remain in use. - Generated metadata/package/installation impact: shipped Python helper and installation documentation change; no generated catalog or setup configuration changes in this PR. Expected effects of the affected runtime workflow: - [x] Read existing files or captured data. - [x] Launch or attach to a process. - [x] Inject instrumentation or run scripts/code (existing Python display helper). - [x] Change process memory, registers, files, or configuration (existing temporary Xauthority files and sockets). - Network services: no TCP listener; the readiness probe connects to a local Unix socket. - Protection recovery: none introduced. ## Evidence and regression coverage - Added coverage in `linuxPrivateDisplay.test.ts` for symlink target permissions/type, dangling targets, and abstract versus filesystem socket readiness. - Base reproduction: the installed helper fails with `mount_validation_failed`; changing only directory inspection exposes Xvfb's filesystem-listener failure. - Executed a real Xvfb probe and authenticated `XOpenDisplay` connection using the changed helper. - Executed the embedded Python regression directly, plus existing dialog, bounded cleanup, and owner-lifetime fixtures for startup and ready phases; all passed. - Patched the installed helper with only the display changes and verified doctor reports `healthy: true` for Hopper. Integration setup was repaired separately and is outside this diff. - Remaining proof gaps: the TypeScript/Vitest harness and full repository checks have not run because checkout dependencies and the pinned development toolchain are absent. No end-to-end Hopper target analysis was run. Whole-task performance metrics were not measured. ## Validation performed - `python3 scripts/hopper-demo-x11.py --probe --strategy direct` — ready on WSLg, outside the execution sandbox. - Python regression, real authenticated X11 connection, and existing Python boundary fixtures — passed outside the execution sandbox. - `rea doctor --provider hopper --client claude_code --client codex --client cursor --client pi --skill --format json --filter-output healthy,environment_healthy,scope,scope_checks,informational_checks` — `healthy: true`, `environment_healthy: true` after the separate approved setup refresh. - `git diff --check` — passed. ## Compatibility, safety, and release - No intended breaking changes or migration. - Real-provider coverage is limited to Xvfb/X11 and Hopper doctor readiness; full Hopper analysis and non-WSLg Linux remain unverified. - No release metadata changes. - TCP remains disabled, Xauthority is retained, and host WSLg files/mounts are unchanged. Abstract sockets share the existing Linux network namespace, as with Xvfb's existing local transport. ## Before merge - [x] This PR addresses a concrete problem and has a focused Conventional Commit title. - [x] Owning documentation is updated and representative doctor results are recorded. - [x] Final diff excludes the local diagnostic output and configuration changes. - [ ] Run required repository checks with the pinned toolchain. - [ ] Verify an end-to-end Hopper analysis and ordinary Linux display behavior. - [ ] Complete maintainer review of transport readiness, authentication, and cleanup coverage. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5527
No description provided.