GeezerVison is showing github.com — feat(amd): Sunshine+Moonlight primary desktop, Helium CDP, encoder watchdog (#5924) by dezren39 · Pull Request #6088 · developing-today/code
Conversation
dezren39
commented
Nov 5, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements the GUI-access verdict in #5924 for host amd. Runbook: doc/2026-11-04_remote-gui-access-runbook.md (decision table, per-path proxy verdicts, activation checklist, blocker taxonomy).
What changed
nixos/hosts/amd-sunshine.nix (new) — services.sunshine as a user service chained to the graphical session: capture = "kms" (the path that works under this host's Hyprland/wlroots session), encoder = "vaapi" (Radeon 780M iGPU; vainfo on the machine confirms VAAPI H.264 + HEVC EncSlice), capSysAdmin = true, openFirewall = false — reachable via the trusted tailscale0 interface only, never opened to the LAN. Moonlight-Qt added as the client package.
The encoder alarm — the config pin is only a preference: in the pinned Sunshine source (src/video.cpp, probe_encoders), a rejected encoder logs Couldn't find any working encoder matching [vaapi] and the probe falls through to software. So the module ships sunshine-encoder-check: a user oneshot + hourly timer that fails into systemctl --user --failed on a rejected pin, no working encoder, or a software winner (Found H.264 encoder: … [software] / Creating encoder [software]), and passes only on VAAPI evidence. Log patterns were matched against the pinned source's actual strings, and the verdict logic was exercised against synthetic journals for all four cases (vaapi OK / software FAIL / pin-rejected FAIL / no-evidence inconclusive).
nixos/environment/default.nix — scaleElectron2x generalized to wrapElectronWithFlags (existing apps' derivations unchanged). Helium now carries --remote-debugging-address=127.0.0.1 --remote-debugging-port=19222 on every launch path (bin wrapper + repointed desktop entries). Before this, the installed Helium exposed no CDP port at all. Note: this module is shared — host nixos gets the same CDP-on-loopback Helium. The tailnet path is a tailscale serve mapping created at activation (fleet convention: serve state is imperative, never declared).
Verification
- Full config eval; rendered
sunshine.conf = capture=kms, encoder=vaapi, port=47989.
- Checker derivation builds; Helium CDP wrapper builds — the wrapper execs helium with all three flags and the desktop entries point at it.
- CDP smoke test, sandbox → laptop, over the production-shaped route (runtime CONNECT proxy :3130 → tailnet IP → temporary
tailscale serve mapping → throwaway Helium on scratch port 19223): /json/version ✓, /json/list ✓, WebSocket Runtime.evaluate("1+1") → 2 ✓. All scaffolding removed afterwards; the live desktop browser was not touched.
- Full toplevel closure build: see the design: remote GUI evaluation — performant desktop for the human client, cheaper answer for agents #5924 comment for the final status line.
Activation is staged, deliberately
No switch was run: the laptop desktop session is actively in use, and a switch can restart it. Merging ≠ switching. When the desktop is free and no switch is running, runbook §5 is the ordered checklist (switch → serve mapping for 19222 → Helium relaunch → web-UI credentials → Moonlight pairing → sunshine-encoder-check during a real stream — the #5924 spike criterion). Post-activation items that are intentionally NOT in this PR: Sunshine web-UI credentials and Moonlight pairing state (imperative, under ~/.config/sunshine, never in the repo).
Fleet-proxy study (in the runbook, §4)
Streaming stays tailnet-direct (UDP; a TCP CONNECT proxy cannot carry it and WireGuard already does it better). CDP rides the CONNECT proxy + serve (proven above). RustDesk stays on its dedicated SSH forward until the #5694 splice is built; the broker protocol is request/response-shaped and carries no byte streams. SSH stays on laptop-ssh.sh. No live routing was changed.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…tchdog (#5924)
Implements the GUI-access verdict of #5924 for host amd:
- nixos/hosts/amd-sunshine.nix (new): services.sunshine as a user
service, KMS capture for the Hyprland/wlroots session, encoder
preference-pinned to VAAPI (Radeon 780M; vainfo-verified H.264+HEVC
EncSlice), openFirewall=false so it is reachable over the trusted
tailscale0 interface only. Moonlight-Qt installed as the client.
- The pin alone cannot guarantee hardware encoding: in the pinned
Sunshine source (src/video.cpp probe_encoders) a rejected encoder is
logged and the probe falls through to software. So the module also
ships sunshine-encoder-check — a user oneshot + hourly timer that
FAILS into `systemctl --user --failed` when this boot's journal shows
the pin rejected, no working encoder, or a software winner
("Found H.264 encoder: ... [software]" / "Creating encoder
[software]"), and passes only on VAAPI evidence. Verdict logic tested
against synthetic journals for all four cases.
- nixos/environment/default.nix: scaleElectron2x generalized to
wrapElectronWithFlags (existing apps unchanged); Helium now also
carries --remote-debugging-address=127.0.0.1
--remote-debugging-port=19222 on every launch path, so CDP survives
restarts/logins. The tailnet path is a `tailscale serve` mapping made
at activation (fleet convention: serve state is imperative).
- doc/2026-11-04_remote-gui-access-runbook.md: decision table
(Sunshine primary / RustDesk fallback / CRD break-glass / agent
hierarchy API > CDP > AT-SPI > stills), fleet-proxy verdicts per
path (streaming stays tailnet-direct UDP; CDP rides the CONNECT
proxy; broker carries no streams), activation checklist, and the
blocker taxonomy (real vs not-a-blocker).
Verified: full config eval; sunshine.conf renders capture=kms +
encoder=vaapi; checker and Helium CDP wrapper derivations build (the
wrapper execs helium with all three flags; desktop entries repointed);
CDP smoke test from the sandbox through the runtime CONNECT proxy
(:3130) to a throwaway Helium on a scratch port via a temporary serve
mapping — /json/version, /json/list, and a WebSocket Runtime.evaluate
all passed; scaffolding removed afterwards. Activation (switch +
serve mapping + pairing + the in-session encoder spike) is staged for
when the desktop session is free; the runbook §5 is the checklist.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 46 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
5b9c7866-701e-42d6-a4db-71e840701bc2
Commits
-
Reviewing files that changed from the base of the PR and between e90672d and efeb71a.
Files selected for processing: 4
-
doc/2026-11-04_remote-gui-access-runbook.md
nixos/environment/default.nix
nixos/hosts/amd-sunshine.nix
nixos/hosts/default.nix
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-05T06:09:48.128035Z |
efeb71a |
PR opened |
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: efeb71a1c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+124
to
+128
|
|
systemd.user.timers.sunshine-encoder-check = {
|
|
|
Unit.Description = "Hourly Sunshine encoder check (code#5924)";
|
|
|
Timer = {
|
|
|
OnBootSec = "10min";
|
|
|
OnUnitActiveSec = "1h";
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Register the new Sunshine watchdog schedule
This enables a laptop systemd timer running ten minutes after boot and hourly thereafter, but doc/fleet-schedule-registry.md is unchanged and contains no Sunshine entry (checked with git grep -n -i sunshine 3f4c454f -- doc/fleet-schedule-registry.md). The scheduled workload will therefore be invisible to the fleet placement audit. Add the timer to Surface 2b with its cadence and service pointer in the same change, as required by the root AGENTS.md fleet-schedule rule.
AGENTS.md reference: AGENTS.md:L53-L58
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 5, 2026
dezren39
pushed a commit
that referenced
this pull request
Nov 5, 2026
…de#5924)
CDP-everywhere audit follow-up to PR #6088 (Helium): the other Chromium-family browsers in the shared desktop config were installed raw, so their DevTools endpoint existed only when a caller passed flags itself. Fleet port convention: 19222 Helium, 19223 Brave, 19224 Chromium, all bound to 127.0.0.1 only (remote path stays loopback + tailscale serve / CONNECT proxy per doc/2026-11-04_remote-gui-access-runbook.md). Chromium gets a bin-only wrapper (its desktop file uses a bare Exec=chromium resolved via PATH; wrapElectronWithFlags cannot be reused because the package symlinks share/applications into chromium-unwrapped and the helper desktop rewrite fails on the read-only target). Brave gets the full wrapper treatment in home/common (binaries wrapped, desktop entries repointed). Wrapper flags precede caller args, so playwright/puppeteer callers passing their own --remote-debugging-port still win. Firefox and Zen (Firefox-family) have no CDP; their remote protocol is WebDriver BiDi, left unconfigured and documented as a gap on #5924. Verified: both new derivations built and inspected (flags present; Brave desktop Exec repointed); changed modules evaluate for hosts amd and nixos. No switch performed -- activation rides the next system switch.
This was referenced Nov 5, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|