Repository navigation
fix: give the restarted windows gateway a hidden console - #32087
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns. The fix fixes the cause: the respawned gateway had no console because of Notes
[DESIGN-REVIEWED] cb8a0e9 Description read[DESCRIPTION-READ] 296bafda1b1823fcbc57202da910ba50b5d4ee7e47614610fcad113d6b849ccb That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. This is a one-flag fix for the cause, with an issue behind it (#27775). The test pin it rewrites is named in the description, along with the old value ("main passes Not checked: whether the gateway outlives its window closing in Windows Terminal. The author also could not run that case. What this change shipsInventory (4 items) — 4 justifiedIntent: stop console windows popping up for programs the gateway starts after
[FIRST-PRINCIPLES-REVIEWED] cb8a0e9 Description read[DESCRIPTION-READ] 5ac533bcb95c45e34a5786edefae84064bf59eadebcedf76ac63f521410fe796 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
3b925e9 to
0eadf00
Compare
0eadf00 to
c3550e9
Compare
c3550e9 to
b812b8b
Compare
b812b8b to
cb8a0e9
Compare
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved: PR Readiness passed on cb8a0e9, and all five review lanes (Opus 5.5, GPT 6.1, Design, UX, First Principles) report no blocking finding on this head. No conflict and no open change request.
(cherry picked from commit 430c260)
Problem / Motivation
Goal: After
kirocrew restarton Windows, the programs the gateway starts stop opening visible console windows.After
kirocrew restarton Windows the replacement gateway has no console. Every console program it later starts with onlyCREATE_NEW_PROCESS_GROUP(the update check'sgit, script hooks, app backends, frontend builds) gets a new, visible console window.Why it matters
Every Windows user who runs
kirocrew restartsees black console windows flash or stay open on their desktop for as long as that gateway runs.Not a goal
CREATE_NO_WINDOWat each child spawn site.dev_fleet's own child (apps/builtins/dev_fleet/gateway_service.py).What changed (motivation → approach → change)
On Windows the restarted gateway now owns one hidden console, so the console programs it starts share it and open no window. POSIX is unchanged.
The respawn in
cli_server_restart.pypassedDETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP.DETACHED_PROCESSgives the gateway no console at all, so Windows makes a new visible one for each console child. The respawn now passesCREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP: the gateway gets a console with no window, and its children inherit it. It still runs in its own process group and outlives the terminal that ran the restart.The rule comments in
platform_compat_native.pyand the respawn bullet indocs/system-specs/modules/cli.mdstate the new flags.Backwards compatibility
Compatible: only the Windows creation flags of the restarted gateway change; the command, its output and POSIX behaviour stay the same.
Removes nothing: no path, record, key or function is taken away; the
DETACHED_PROCESSconstant stays for its other caller.Tests
test_spawn_detached_gateway_uses_kirocrew_binnow runs on every OS. It pins the three Windows flag values and assertscreationflags == 0x08000200(CREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUP); main passes0x208. The POSIXstart_new_sessioncheck stays.Proof: PROVEN test/test_cli_restart.py::TestRestart::test_spawn_detached_gateway_uses_kirocrew_bin (head b812b8b)
Determinism: 20 runs at
-n0, 10 runs at-n 4 --dist loadgroupbesidetest_platform_compat_coverage.pyandtest_windows_spawn_off_loop.py, and the wholetest_cli_restart.pyin a shuffled order (seed 27775, 42 ids): all green.Targeted tests: every test file that names
cli_server_restart,platform_compat_nativeor_SUBPROCESS_NO_WINDOW(1071 passed, 196 skipped). One failure,test_stdlib_shadow.py::TestDetection::test_remedy_is_shell_safe_or_absent, fails the same way on main on this Windows host and does not touch this code.Manual verification
Real
kirocrew restarton native Windows Server (Python 3.12), scratchKIROCREW_HOME, port 6927. Terminal A (classic console) rankirocrew gateway; terminal B (another classic console) rankirocrew restart. Then each process under the new gateway was listed with its console and console window, terminal B was closed withWM_CLOSE(what the X button sends), andkirocrew statuswas run 30 s later.kirocrew statusOn main the first console program the gateway started (the venv
python.exe) made its own new console and window. On the branch no process in the tree owns a console window.Not run here: Windows Terminal as terminal B, one tab or one of two tabs. This host has no signed-in desktop session, and Windows Terminal refuses to start (
Access is denied). The issue's stand-in check already covers aCREATE_NO_WINDOW | CREATE_NEW_PROCESS_GROUPchild surviving its Windows Terminal window closing, 3 of 3.Related Issues
Closes #27775
Sibling sweep
Swept: git grep -nE "DETACHED_PROCESS" -- src/
Sibling: src/kiro_crew/apps/builtins/dev_fleet/gateway_service.py:731 -- not affected -- dev_fleet starts its own child, out of scope per the issue triage
Pattern harvest
Not generalizable: the respawn is the one place the product makes a long-lived, console-less Windows parent of console children.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)