HydraIssues

hydrabody restartSunshine shows visible console window over kiosk
closed bug Project: hydrabody Reporter: 22 Apr 2026 20:42

Description

Symptom

On boom-pickle-38 (node-74f9fbf2, Visit Flanders / Rupelmonde), after a Windows reboot the stream from peppy to boom-pickle works — Rupelmonde renders correctly in the stream — but the kiosk view now shows a visible sunshine.exe console window on top of kioskoverlay.exe. On a clean boot without hydrabody restarting Sunshine, the console is hidden.

Root cause

startInInteractiveSession in pkg/provider/session_windows.go:33-109 does NOT set STARTF_USESHOWWINDOW + SW_HIDE on its syscall.StartupInfo:

si := syscall.StartupInfo{
    Cb:      uint32(unsafe.Sizeof(syscall.StartupInfo{})),
    Desktop: desktop,
    // no Flags, no ShowWindow
}

Its sibling startInInteractiveSessionWithArgs in the same file (line 119+, used for kioskoverlay) DOES set them (line 161-162):

Flags:      0x00000001, // STARTF_USESHOWWINDOW
ShowWindow: 0,          // SW_HIDE — hide console window

The asymmetry is the bug.

Path to the symptom

startInInteractiveSession is called from restartSunshine() in pkg/provider/vdd_windows.go:437, which fires whenever hydrabody's VDD health check detects config drift (vdd_windows.go:90, vdd_windows.go:158). On a cold boot Sunshine is started by Windows autostart — different code path, console hidden. On reboot plus VDD drift, hydrabody taskkill's Sunshine and re-spawns it via startInInteractiveSession, which fails to set SW_HIDE, so the console becomes visible and sits above the kioskoverlay (kioskoverlay is hwndBottom).

Fix

In pkg/provider/session_windows.go:77-80, update the StartupInfo to mirror startInInteractiveSessionWithArgs:

si := syscall.StartupInfo{
    Cb:         uint32(unsafe.Sizeof(syscall.StartupInfo{})),
    Desktop:    desktop,
    Flags:      0x00000001, // STARTF_USESHOWWINDOW
    ShowWindow: 0,          // SW_HIDE
}

Two-field diff, same value as the already-working sibling. No API change.

Verification

  1. Build + release hydrabody with the change.
  2. Land on boom-pickle-38 via auto-update.
  3. Reboot the body.
  4. Observe that on reboot, even if restartSunshine fires, no console window appears over the kioskoverlay; stream still delivers Rupelmonde frames correctly.

Related

This emerged while diagnosing #110 (Rupelmonde stream delivers audio but wrong video). That issue's underlying symptom was cleared by a full reboot — not a config bug. This console-window bug is a separate, visible side-effect of hydrabody's Sunshine respawn path.

Constraints / reminders

  • WDAC blocks binary replacement on bodies — ship via CI/release/auto-update, not manual deploy.
  • No direct edits to apps.json on bodies (hydrabody's tickSunshineApps rewrites every 30 s).
  • User has asked to not touch this until after the weekend — file and park.

Comments (1)

claude (cederik) 29 Apr 2026 21:24

Fixed in hydrabody v1.11.23 (CREATE_NO_WINDOW in startInInteractiveSession instead of just SW_HIDE on StartupInfo, since SW_HIDE only suppresses GUI window first-show, not OS-managed console windows from CREATE_NEW_CONSOLE). Verified on cosmic-pretzel-98 today (2026-04-29): killed Sunshine, hydrabody auto-restarted it via the patched path, body desktop screenshot shows clean Hydra splash with no sunshine.exe console window. Closing.