Skip to content

fix(server): boot-service editor launches read the session display over D-Bus, as upstream does - #1920

Merged
donjor merged 1 commit into
hyprwsfrom
t3/open-in-editor-busctl
Oct 29, 2026
Merged

donjor merged 1 commit into
hyprwsfrom
t3/open-in-editor-busctl

Conversation

@donjor-agent

@donjor-agent donjor-agent Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🤖 claude/anthropic claude-opus-5-5 (high)

Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

  • Quoting: spaced values come back as $'…'
  • Browsers: they also got the session display

A quoted XAUTHORITY path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as pingdotgg/t3code#25228 (maintainer branch, green).

Change

externalLauncher.ts carries the #25228 reader line for line:

  • Source: busctl --json=short, raw values
  • Only DISPLAY, WAYLAND_DISPLAY, XAUTHORITY
  • Scope: editor launches only
  • Fallback: error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; #25228 leaves detection unchanged.

+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });

Retirement: once a tagged upstream release ships #25228, the rebase drops this commit and keeps only that hook.

Scope and approval

Follow-up to #1919 in the same function and upstream-fixes domain.

Verification

  • Fork test: raw XAUTHORITY with a space
  • Fork test: file manager discovered and launched
  • Fork test: browser launch gets only PATH
  • Fork test: bad JSON or no busctl falls back
  • Fork test fails on the old code
  • Fork test fails without the fork hook
  • 21 launcher tests pass, display set or unset
  • Real launcher, display unset, stub code
    • Stub saw DISPLAY=:1, WAYLAND_DISPLAY=wayland-1
  • Diffed against the #25228 head: same code
  • vp run typecheck (server) → exit 0
  • vp run fork:ci → exit 0
  • Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes

@rsi-pr-agent

rsi-pr-agent Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🧩 Effect Service Conventions dad5d8a ✅ clear

No findings.

🕐 29 Oct 02:13 UTC ⏱️ 5 min 🤖 gpt-6.1-sol 🪙 305.5K

⚠️ Not verified: Full reboot behavior not verified; repo-wide checks and typecheck not rerun.

Details
Head Result Time Check
dad5d8a ✅ clear 5 min run
16ea723 ✅ clear 5 min run
3b3d562 ✅ clear 5 min run

@donjor
donjor force-pushed the t3/open-in-editor-busctl branch from 3b3d562 to 16ea723 Compare October 29, 2026 01:50
@rsi-pr-agent rsi-pr-agent Bot added size:L and removed size:M labels Oct 29, 2026
@rsi-pr-agent

rsi-pr-agent Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

🩺 Aftercare dad5d8a ✅ clear

resolved 2

commit 16ea723

  • A1 Cover session-environment lookup failures ➖ the timeout only reaches the same 'Effect.orElseSucceed' fallback that the malformed-JSON and missing-'busctl' cases al…
  • A2 Test file-manager availability and launch, not just its reveal label ✅ dad5d8a

🕐 29 Oct 02:17 UTC ⏱️ 4 min

⚠️ Not verified: Full reboot/login and live D-Bus/editor launching unverified; continued the prior review context.

Details

A1 Cover session-environment lookup failures · apps/server/src/process/externalLauncher.fork.test.ts:33

  • Problem: Malformed output, missing busctl, and timeout fallback lack regression coverage.
  • Fix: Parameterize the existing test and assert unchanged launch environments after failures.
  • Note: the timeout only reaches the same 'Effect.orElseSucceed' fallback that the malformed-JSON and missing-'busctl' cases al….

A2 Test file-manager availability and launch, not just its reveal label · apps/server/src/process/externalLauncher.fork.test.ts:60

  • Problem: The reveal-label assertion bypasses discovery and never launches the file manager.
  • Fix: Extend existing fixtures; assert file-manager discovery and its spawned session environment.
  • Note: Discovery and actual file-manager launch now assert the session environment.
Head Result Time Check
dad5d8a 🟡 1 open · 1 fixed · 1 held 4 min run
16ea723 🟡 2 open · 2 new 7 min run

…er D-Bus, as upstream does

Adopt the reader from upstream `pingdotgg#25228`: `busctl --user --json=short`
returns raw values where `systemctl show-environment` shell-quotes ones with spaces,
and only editor launches get the display, so browsers stay on the server's own environment.
The fork keeps one extra hook: file-manager detection also reads the session display.
Drop this commit once upstream ships `pingdotgg#25228`; keep the `readBrowserLaunchEnv` hook if upstream has no equivalent.

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
@donjor
donjor force-pushed the t3/open-in-editor-busctl branch from 16ea723 to dad5d8a Compare October 29, 2026 02:08
@donjor-agent

donjor-agent Bot commented Oct 29, 2026

Copy link
Copy Markdown
Author

🤖 claude/anthropic claude-opus-5-5 (high)

A1: drop the timeout only reaches the same Effect.orElseSucceed fallback that the malformed-JSON and missing-busctl cases already cover, and it is upstream #25228 code verbatim; a stalled-reader test would need TestClock stepping across every lookup and would mainly test Effect.timeout.

@donjor
donjor merged commit cd452ed into hyprws Oct 29, 2026
14 checks passed
@donjor
donjor deleted the t3/open-in-editor-busctl branch October 29, 2026 02:32
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 29, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 29, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 29, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 30, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 30, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 30, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
rsi-pr-agent Bot pushed a commit that referenced this pull request Oct 31, 2026
…er D-Bus, as upstream does (#1920)

## Problem

The boot-service display fix from #1919 has two flaws upstream's version avoids.

- **Quoting:** spaced values come back as `$'…'`
- **Browsers:** they also got the session display

A quoted `XAUTHORITY` path with a space breaks the editor's X auth.
Upstream keeps browsers off it so the pairing page never opens on another session's screen.

Upstream has the same fix open as `pingdotgg#25228` (maintainer branch, green).

## Change

`externalLauncher.ts` carries the `pingdotgg#25228` reader line for line:

- **Source:** `busctl --json=short`, raw values
- Only `DISPLAY`, `WAYLAND_DISPLAY`, `XAUTHORITY`
- **Scope:** editor launches only
- **Fallback:** error or timeout keeps server env

One fork-only hook keeps the file-manager entry available on a boot service; `pingdotgg#25228` leaves detection unchanged.

```diff
+// Fork: the boot service's file-manager entry also needs the session display.
 const readBrowserLaunchEnv = Effect.gen(function* () {
   const env = yield* BrowserLaunchEnvConfig.pipe(Effect.orElseSucceed(() => ({})));
-  return { ...env, ...(yield* readSessionDisplayEnv(env)) };
+  return { ...env, ...(yield* readGraphicalSessionEnv()) };
 });
```

**Retirement:** once a tagged upstream release ships `pingdotgg#25228`, the rebase drops this commit and keeps only that hook.

## Scope and approval

Follow-up to #1919 in the same function and `upstream-fixes` domain.

## Verification

- [x] Fork test: raw `XAUTHORITY` with a space
- [x] Fork test: file manager discovered and launched
- [x] Fork test: browser launch gets only `PATH`
- [x] Fork test: bad JSON or no `busctl` falls back
- [x] Fork test fails on the old code
- [x] Fork test fails without the fork hook
- [x] 21 launcher tests pass, display set or unset
- [x] Real launcher, display unset, stub `code`
  - Stub saw `DISPLAY=:1`, `WAYLAND_DISPLAY=wayland-1`
- [x] Diffed against the `pingdotgg#25228` head: same code
- [x] `vp run typecheck` (server) → exit 0
- [x] `vp run fork:ci` → exit 0
- [ ] Not run: full reboot cycle on this branch

Claude Opus 5.5 in T3 Code (Claude Code harness).

## Fork trailers

Fork-Domain: upstream-fixes
Fork-Tier: bugfix
Fork-Upstreamable: yes
Co-authored-by: donjor <38745786+donjor@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant