Skip to content

Optionally stop the Steam-tracked host game when exiting MoonDeck - #176

Closed
Cynary wants to merge 3 commits into
FrogTheFrog:mainfrom
Cynary:feat/stop-host-steam-game
Closed

Cynary wants to merge 3 commits into
FrogTheFrog:mainfrom
Cynary:feat/stop-host-steam-game

Conversation

@Cynary

@Cynary Cynary commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Choosing Exit game in local Steam can leave the streamed host game running. This adds a default-off Game Session → Stop host game when choosing Exit game setting. When enabled at launch, local Steam Exit and the quick-access Exit game on host action ask Buddy to stop the game and confirm it stopped before closing the local runner.

AI authorship disclosure: OpenAI Codex wrote the implementation and tests at the submitter’s request and performed the builds, automated UI actions, and checks below. This is not independent human review or third-party validation.

Behavior and scope

  • Uses the companion Buddy's Steam process tracking for native games and non-Steam shortcuts. Directly launched non-Steam games can work when Steam keeps tracking their processes. GameStream app entries are excluded.
  • Captures the host and game identity at launch, retaining full 64-bit shortcut IDs as strings. Duplicate requests are coalesced; old responses cannot close newer sessions; unrelated local games bypass the hook.
  • Refused, failed, or unconfirmed stops leave the stream available and report an error. Missing session data does not prove the game stopped. Older Buddy versions fail visibly if this opt-in is enabled.
  • Disconnect, suspension and emergency cleanup retain their existing behavior. Cleanup also tolerates Moonlight exiting before the runner signals it.
  • The UI explains that remaining processes may be force-stopped: save progress before using Exit. This does not perform an in-game save-and-quit.

Requires Buddy PR #202. There are no package, Epic, Ubisoft, executable-directory resolvers or launcher relaunch bypasses in that companion change. Launcher shortcuts may leave Steam tracking the launcher instead of the game, and stopping one may close the launcher. An EXE that hands off to a launcher has the same limitation. Individual launcher-managed games are outside the supported scope.

UI

The rendered MoonDeck Game Session setting from client dcb74c9, enabled for validation (the default is off). Changes apply to the next session. The host stays in regular Steam/Desktop mode.

MoonDeck Game Session setting with Steam-tracking limitation

The enabled quick-access action during an Overcooked! 2 stream:

MoonDeck quick-access Exit game on host button

Build and automated validation

Built and installed clean source heads: client dcb74c9d375af2943465163458bc96ddf300e6a7, Buddy 445cc1d72d3484ed1393aeb7c3d0cf135775e310. The 637 installed client files matched the package SHA256 manifest. The 151 tracked Buddy/SSL source files were verified before the Windows build; installed Buddy and Stream matched their build hashes. These are the PR source heads, without additional deployed source patches.

Passed client checks: proxy/exit regression suite (host-exit.cjs), backend stop confirmation, settings migration/default-off/persistence, real-subprocess cleanup, changed-file ESLint, git diff --check, and Rollup build.

Windows CTest SteamProcessLogTests passed (1/1): native and full 64-bit shortcut IDs, unrelated-app isolation, per-app/PID registration times, removal, and invalid timestamps. BUILD_TRACKING_TESTS is optional and defaults off. This exercises the real Steam log tracker; it does not simulate the entire Windows process lifecycle.

Windows build: Qt 6.8.3, clang-cl 21.1.8, CMake/Ninja and installed MSVC SDK. External flags suppress unused-command-line-argument/unused-lambda-capture warnings and force-include QtHttpServer/QHttpServerRouterRule for affected targets. These are compiler flags, not source patches. An upstream-toolchain or Linux build pass is not claimed.

Live validation on this revision

UM890/Bazzite Gaming Mode client, Moonlight Qt 6.1.0-vrr14, Windows host; 2026-09-11. Codex used actual rendered local Steam/MoonDeck controls via Steam's browser-debugging interface, screenshots, Buddy/runner logs, and host process checks.

  • Overcooked! 2, setting enabled at launch: local Steam Exit sent the host stop request and stopped the game and stream. This passed twice. The host log showed the 1.5-second termination fallback on the first run, followed by Running → Stopped.
  • Overcooked! 2, setting disabled before launch: local Steam Exit ended the stream, and the same host process remained running after cleanup. Re-enabling and reconnecting retained that same game process; the title screen was captured. The setting is captured at session launch, so a mid-session toggle does not change that session's behavior.
  • UI: inspected the revised setting and enabled quick-access button; fresh screenshots are above. On the final reconnect Steam's UI/debugger became unresponsive before an additional quick-access click could be tested. The host game was cleaned up through Buddy's authenticated stop API. Restarting Steam's UI helper restored UI/debugger responsiveness, and the enabled setting persisted. A successful quick-access stop click on this revision is not claimed.
  • Alan Wake Remastered: its EXE shortcut hands off to Epic. Steam removed the original processes from tracking while a game process launched by Epic remained alive; Buddy reported Stopped and the runner timed out. This is an unsupported launcher-handoff case, not a passing direct-executable test. No launcher workaround was added. Earlier Epic/Ubisoft/Game Pass results from the expanded implementation do not validate this simplified revision.
  • Non-Steam coverage: automated tests verify the full 64-bit ID and generic process-tracking path. A complete live launch/exit pass for a genuinely direct non-Steam game is not claimed.

The final host remained configured for regular Steam/Desktop mode. These are smoke tests, not full gameplay, physical-controller, VRR/HDR, Linux-host, pending-launch, or PID/session-race stress validation. No independent review or successful upstream CI result is claimed. Both PRs are ready for maintainer review.

Contribution policy

No standalone AI contribution policy, CONTRIBUTING document, or PR template was found in either MoonDeck repository's current default branch, READMEs, or public wikis. However, the maintainer raised concerns about extensive AI use and Decky Store approval in MoonDeck #174. Decky's current plugin-update template requires declaring that generative AI did not write a majority of the submitted code. That declaration cannot truthfully be made for this implementation. These are source-repository PRs, not a Decky Store submission; disclosure and passing local tests do not establish eligibility for acceptance or store approval.

@Cynary Cynary changed the title Optionally stop the host game when choosing Steam Exit game Optionally stop the tracked host game when exiting MoonDeck Sep 11, 2026
@Cynary Cynary changed the title Optionally stop the tracked host game when exiting MoonDeck Optionally stop the Steam-tracked host game when exiting MoonDeck Sep 11, 2026
@Cynary
Cynary marked this pull request as ready for review September 11, 2026 08:34
@Cynary Cynary closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant