Repository navigation
Write the Windows GUI log to its file directly and stop helper consoles flashing (closes #3768) - #3773
Conversation
Code Review SummaryVerdict: APPROVE with improvements (self-authored PR, so posted as a comment). This is a net improvement and the root-cause fix is the right one: tracing owns the file directly instead of depending on a slot the shell launch poisons. The change is small, cohesive, correctly gated ( Scrutiny points you asked about:
FindingsCritical IssuesNone. Suggested Improvements
Nitpicks
Testing / verification
Docs / process
|
malibio
left a comment
There was a problem hiding this comment.
Review posted in the comment above. Verdict: APPROVE with improvements; no blockers.
Review addressed (61d0575)Addressed (6 of 6, nothing skipped):
Verification: Still open: the manual Start-menu click on an installed build (log lines appear, no flashing consoles, onboarding prefill and tray Quit exercised). Re-Review DecisionDecision: NO RE-REVIEW NEEDED Rationale: every change is a small, mechanical application of the already-reviewed approach (one more flag at two spawn sites, a rotation call that reuses |
Verified on Windows 11 (VM), from a non-release build of this branchInstalled the
Still to record: the number of console windows flashing at startup (previously about 3), reported by the person at the keyboard. |
|
Console windows: none noticed at startup on the same Start-menu launch (previously about 3). Both halves of the change are verified on Windows; ready for merge. |
…es flashing (closes #3768) A launch from the Start menu starts the process with STARTF_HASSHELLDATA, which parks a monitor handle in the stdout slot. While that flag is set, GetStdHandle(STD_OUTPUT_HANDLE) reads back NULL even after SetStdHandle stored the log file, so tracing and println! went nowhere. stderr is unaffected, and launches from PowerShell, the installer finish screen or an Explorer-opened shortcut don't set the flag, which is why only Start-menu launches lost output. - A Windows release build now gives the tracing subscriber the log file itself (no ANSI codes) instead of relying on the stdout slot. - The three menu println! calls become tracing::info!. - reg, taskkill, the CLI check and both skill-installer launches set CREATE_NO_WINDOW; a GUI process has no console, so each child flashed one. - Source-pin tests for both; each fails with its fix removed. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…s, fix stale docs - Rotate nodespace-app.log and its error log at startup, before this process opens them. Tracing now writes to the app log for the whole session, and the daemon's rotation never covered it. - Hide the console of the identity-prefill `git` spawn (tokio Command) and the daemon tray's `taskkill`; the daemon is DETACHED_PROCESS so it flashed too. `id -F` is left alone: it cannot start on Windows, so no console is created. - Reword the redirect and run() comments that still described stdout as reliable; they now state what was measured and why the code avoids the slot. - Tests: drop the exact `hide_console_window(` count in favour of a rule that every non-test Command::new in skill_setup has the helper beside it (Unix absolute-path spawns excluded); match the tracing writer's gate by structure rather than rustfmt indentation; add a rotation test for the app log. - Move the log-file constants above their first use. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
61d0575 to
3416b25
Compare
Summary
Closes #3768.
A Windows launch from the Start menu lost all of the app's own log output (
nodespace-app.logstayed empty), while launches from PowerShell, the installer finish screen or an Explorer-opened shortcut logged fine.Root cause (reproduced and measured on a Windows 11 VM with a standalone harness plus a kernel file-I/O trace): a Start-menu launch starts the process with
STARTF_HASSHELLDATAset, which parks a monitor handle in thestdoutslot. While that flag is set,GetStdHandle(STD_OUTPUT_HANDLE)reads backNULLeven afterSetStdHandlestored the log file, sotracingandprintln!write nowhere.stderris unaffected. The handles were open and the redirect had succeeded, which is why it looked like a log-level or file problem. Clearing the flag in the harness made stdout readable again.Changes
tracingsubscriber the log file directly (daemon_setup::gui_log_writer, no ANSI codes), so the log no longer depends on how the app was started. Thestdout/stderrslot redirect stays forstderr, and its doc comment now states thestdoutcaveat.println!calls becometracing::info!.reg,taskkill, the CLI check and both skill-installer launches go throughhide_console_window(CREATE_NO_WINDOW). A GUI process has no console, so Windows opened and flashed one per child at every startup.Verification
bun run test:changedpasses.cargo xwin checkofnodespace-app-libforx86_64-pc-windows-msvcpasses in the dev and release profiles (the log writer is gated onnot(debug_assertions)).🤖 Generated with Claude Code