PR #178 — Keep the default Windows Ctrl-C termination while loading: worth merging, after two small fixes
The rebased head 43c6ea78 fixes the bug, fixes it in the right place, and fixes it the way the maintainer and my previous review asked for. What remains is a stale PR description and one unrun compile check — no design objection.
The bug is real and the fix is correct
On main, the Windows console handler is still installed in run() at flare-cli/src/main.rs:187–192, before core download (load_core, main.rs:397–465), trust verification, and NativeModel::load_agreeing (main.rs:288–314). stop_console returns 1 ("handled") for CTRL_C_EVENT | CTRL_BREAK_EVENT (main.rs:737–746), which suppresses Windows' default termination. The only pre-serving STOP readers are distribution.rs:192 and launch.rs (not opened), and both modules are #[cfg(unix)] (main.rs:9–33). So on Windows a Ctrl-C during download, weight load, or graph instantiation was recorded into an atomic nothing read — force-kill was the only exit. That is precisely issue #113's symptom, and #113's reporter was on Linux, where later builds fixed it; the Windows instance of the symptom was never filed.
The diff is a net +7/−6 in flare-cli/src/main.rs plus a two-line doc rewrite, with no new module, no new dependency (windows-sys with Win32_System_Console is already at flare-cli/Cargo.toml:49), no new branch in shared code, and no effect on the supported model/GPU matrix.
What this revision got right
- Right file. It now edits
flare-cli/src/main.rs; the earlier head editedflare/src/main.rs(not opened), deleted infa158284. Therun()block is removed (confirmed againstflare-cli/src/main.rs:178–190on the PR head). - Right function. One registration in
serve_local(flare-cli/src/main.rs:704–710, just before the loop at:714), not inserve(). On Windowsclusteris alwaysNone(membership isNoneat:267–268, and rank/rendezvous/hosts/RoCE are rejected at:178–186), soserve()dispatches at:596–598and never starts a server on Windows; a registration inserve()would have been dead code. - Right position. After
loaded.start()rather than before.LoadedSession::startrunsServer::startand startup tuning graphs under a 120 s deadline (helios/src/server/session.rs:48–80,helios/src/execution/transport.rs:759–773) with noSTOPreader, so registering before the start would have re-swallowed Ctrl-C for up to two minutes — exactly the complaint. Returning on a registration failure after the start is safe:DrainGuardandServingSession::drop()retain or drain the owner (helios/src/server/session.rs:55–57, 96–133). - Docs match the code.
docs/windows.md:141–142now reads "Ctrl-C and Ctrl-Break end loading immediately and drain native work before releasing CUDA resources once serving has started." Rewritten in place, no new section. - DCO.
43c6ea78carriesSigned-off-by: Mark Yongand a refreshedDesign-Signed-Off-By: …; design-review=c3a9, matching the currentdocs/design-review.mddigest scheme (docs/design-review.md:281–299).CONTRIBUTING.md:9–11is satisfied.
So the two hard blockers from the 2026-11-18 review and from my 2026-11-26 report — deleted file, wrong placement — are gone.
Two things still to fix before merge
- The PR description contradicts the code (must fix). It still says "Register the handler immediately before
Server::start", "A Ctrl-C duringServer::startsetsSTOP, so the serving loop exits at once", and "Registering before the start also means a registration failure returns before replay begins, instead of dropping the package owner without a confirmed drain." All three describe the abandoned placement. The author's 2026-11-28 comment says the description was updated to43c6ea78; the body on GitHub is unchanged from 2026-11-03.AGENTS.md("Required PR descriptions") makes the four-part description mandatory and forbids publishing text the reviewer must reconcile against the diff, and the agency skill on prose requires a description to describe the code as it is. Also replace "package" with "core" throughout, per the repo's current vocabulary. - No Windows compilation evidence (should fix).
43c6ea78has zero check runs and zero workflow runs (fork PR, workflows not approved), and the Linuxcargo test --manifest-path flare-cli/Cargo.tomlrun (221 passed) never compiles#[cfg(windows)]code. This misses the charter's "bring real evidence". The fix is cheap and needs no GPU:cargo xwin build --locked --release --manifest-path flare-cli/Cargo.toml --target x86_64-pc-windows-msvc, the exact commanddocs/windows.md:24–39documents, or simply approving.github/workflows/native-serving.yml(not opened), which already buildsflare-clionwindows-2022for everypull_request(:6, :20–21, :45). The live Ctrl-C session (Ctrl-C during loading exits at once; Ctrl-C after "Start server" drains) can stay the explicitly unrun check — there is no portable regression test for console-handler ordering.
Who benefits, and what it costs
Windows is a documented, first-class target (docs/windows.md is a full guide, CI builds and tests on windows-2022, releases ship Windows x64/ARM64). Every Windows user who starts flare run and changes their mind during a multi-tens-of-GB download or a long weight load benefits, on the first-encounter path. Breadth is moderate, value per affected user is high.
Cost is negligible: an existing API call moved a few dozen lines, no new abstraction, near-zero maintenance, no runtime cost, and no Unix exposure (the entire change is #[cfg(windows)]).
There is a useful side effect the PR never mentions: deleting the early registration also stops swallowing Ctrl-C in flare download and flare models download on Windows, whose paths (flare-cli/src/hub.rs:12–28) never read STOP. Interrupted Hub transfers resume from their .part files (flare/src/hub.rs:3875–3918, 4585–4598), so an abrupt exit there costs little.
Is there a simpler path? No — I checked, and the obvious one is worse
The repo has a scoped abort-on-Ctrl-C primitive, heliopause::processes::CliSignals (heliopause/src/processes_windows.rs:16–51), used by Ignition's serving path. It is the wrong tool here: heliopause is a pyo3 cdylib (heliopause/Cargo.toml:9–11, 22, 48), so depending on it would drag pyo3 and OpenSSL into the CLI, and its Windows handler calls ExitProcess(130), which bypasses CUDA teardown and would break the very drain guarantee docs/windows.md:141–142 promises. A pure relocation of the existing handler is the smallest correct change, which is what the charter asks for.
Verdict
Worth merging. It fixes a real, reproducible Windows bug on a supported platform for roughly one net line, at zero Unix risk and zero maintenance burden — squarely "solve the right problem in the right place" with "the smallest footprint". Not worth merging until the description is rewritten to match the code (the current one describes a Server::start placement this diff does not implement) and a Windows cargo xwin build or the existing native-serving.yml Windows job result is posted. Neither is a design change; both are the standard "spell out exactly what's needed" items, and neither is a reason to decline this contributor's work.