Repository navigation
fix: keep desktop commands inside lab sessions - #82
Merged
Merged
Conversation
1 of 18 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Commands started next to a desktop session could inherit Wayland variables and open on the developer's real desktop. PickLab then returned a plausible black screenshot with no explanation.
What
WAYLAND_DISPLAY, removes other inheritedWAYLAND_*variables, sets the sessionDISPLAY, and forces X11 backends for GTK, Qt, SDL, winit, andXDG_SESSION_TYPE.desktop launchpath.picklab desktop execand MCPdesktop_exec. They start an argv array in a dedicated process group, wait a bounded time for a new client window, and stop the group before reporting a possible real-desktop escape when none appears.picklab desktop envtext and JSON recipes for parent shells.xdotoolwarning when counting is unavailable.desktop launch(e.g.flutter run) #73 is scheduled to merge first. No rule or path is allowlisted.Review follow-ups
WAYLAND_DISPLAY=picklab-no-waylandwhile keeping all other inheritedWAYLAND_*variables removed, so raw libwayland clients cannot fall back towayland-0.desktop execfail closed by stopping and verifying the process group before reporting a possible real-desktop escape, with a--window-timeouthint for slow first builds.xdotool, return a missing-tool warning, and skip the zero-window escape warning when the count is unavailable.How it was verified
bun install --frozen-lockfile-> passed, 646 packages installed.bun run typecheck-> passed.bun run lint-> passed.bun run build-> passed for all TypeScript packages.bun run test packages/desktop-linux/test/environment.test.ts packages/desktop-linux/test/integration.test.ts-> 24 passed, 4 skipped. The real Xvfb/xdotool GTK test passed with inherited Wayland variables and confirmed the window belonged to the Xvfb display.PATH="<temporary-xterm-shim>:$PATH" bun run test-> 91 files passed, 1,145 tests passed, 2 skipped. The temporary shim used installed Zenity, accepted the xterm title arguments exercised by the suite, and only received test-created Xvfb displays.PATH="$PWD/.validation-bin:$PATH" bun run test:coverage-> passed, 82.47% statements/lines, 86.19% branches, 88.57% functions.complexity-gate check --changed-> passed.Not verified
flutter run -d linuxon the developer's real Wayland session was not run, to avoid touching the live display.Closes #73
Security review follow-ups
desktop_launchanddesktop_execworking directories to the real project path, rejecting absolute and relative escapes.