Repository navigation
Daemon: start every program without a console window on Windows - #157
Merged
Merged
Conversation
…ling) Co-authored-by: qa-runner2-star <319404260+qa-runner2-star@users.noreply.github.com>
Co-authored-by: qa-runner2-star <319404260+qa-runner2-star@users.noreply.github.com>
svemyh
reviewed
Oct 27, 2026
svemyh
left a comment
Contributor
There was a problem hiding this comment.
Independent review of 9bcbbab: every spawn reachable from the daemon (reason session list every 15 s, the __relay start, mail delivery to agent CLIs, curl, reg, update/--version, notify/ask) now goes through util::no_window; the helper is a no-op off Windows; the Windows CI test proves a DETACHED child gets no console. This is the cause of the console windows flashing every few seconds reported by a Windows/OpenCode user on 10-21 (CLI 0.2.504). Merging.
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
On Windows the daemon runs without a console (
daemon --service, relaunched hidden with CREATE_NO_WINDOW), but the console programs it starts were spawned without CREATE_NO_WINDOW, so Windows gave each one a new console window that flashed open and closed. The repeating flash came fromreason session listevery 15s, plusreason network __relayrestarts,curl(update check, relays),reg query(service check),exe tray,exe --version, and agent CLIs for mail.What
util::no_window(cmd)sets CREATE_NO_WINDOW on Windows for bothstdandtokioCommands. It does nothing on other platforms.src/daemon/**,src/relays.rs, and theregcalls insetup.rsthat the daemon reaches now goes through it.notify.rs's hand-set flag also goes through the helper now.windows-sysgains theWin32_System_Consolefeature for the test.Tests (red, then green)
util::tests::every_program_the_daemon_starts_goes_through_no_window(all platforms): scans the daemon's sources forCommand::new/Command::fromcalls that are not wrapped inno_window(. On the red commit it failed on Linux, macOS and Windows with 17 raw spawns.util::tests::a_child_started_without_a_console_gets_no_window(Windows only): starts the test exe with DETACHED_PROCESS (no console, as the daemon runs), and that process starts a child throughno_window. The test assertsGetConsoleWindow()is null in the child. On the red commit (helper stubbed as a no-op), windows-latest failed with "the child had a console window".245 passed; 2 failed. The commits after it add the fix and normalize CRLF in the scan test, because Windows checks out with CRLF.cargo fmt --check,cargo clippy --all-targets --locked -- -D warningsandcargo test --lockedpass (257 + 2). This PR's CI covers Linux, macOS and Windows.Not verified
No screenshot from an interactive Windows 11 desktop. The windows-latest test checks for the console window directly instead.
Releasing and the monorepo pin bump are left to the engine owner.
Contributors