Repository navigation
fix(pod): count a booting Windows pod in active_names - #32143
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. Notes
[DESIGN-REVIEWED] 0cd3b3d Description read[DESCRIPTION-READ] d7699f0e201835cb6bf9df918410c3d4a36ac665d3ed3a16ccb96e37f0efcf34 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 The fix works at the mechanism level and reuses the existing Not checked: whether Remove refuses on a real Windows host while a pod is booting (the author also lists this as still needed). What this change shipsInventory (5 items) — 5 justifiedIntent: on Windows, stop Remove or Prune from deleting a worktree checkout while a pod is still booting from it. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 0cd3b3d Description read[DESCRIPTION-READ] d5e7b0afc3b9755ef2627e9eb77417fa754ebe93b012d52dc6af318b65d9263b 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: |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 0cd3b3d, no conflict, no open change request.
Problem / Motivation
Goal: On Windows, a pod whose boot is still in progress counts as active in
active_names, so worktree removal refuses to delete a checkout that boot is using.#30971 made a Windows pod read as active in
unit_statewhile its boot's producer process is alive, before any gateway pid exists. Worktree removal readsunit_stateonly when the pod backend is absent. When the backend works, Remove and Prune checkactive_names, and on Windows that lists only pods with a gateway pid record. A boot that has not spawned its gateway yet has only a run record, so it was invisible there.Why it matters
Between the moment a boot claims its run and the moment its gateway pid is recorded, the boot validates the checkout and seeds HOME. A Remove in that window found no active pod and could delete the checkout under the boot.
Not a goal
unit_statereads a boot, or to the Linux and macOS backends.What changed (motivation → approach → change)
active_namesinpod/windows.pynow enumerates the plane's run records (.winrun) as well as its pid records (.winpid). A name counts when its boot is in progress or its gateway pid is live: the same answerunit_stategives, through the same helper. An unreadable run record counts as a boot in progress, because the answer guards a deletion.Backwards compatibility
Compatible: a pod with a live gateway is listed exactly as before. A Windows pod whose boot is in progress is now listed too, so while it boots, Dev Fleet shows it running,
pod lslists it, the checkout pin guard refuses it, and its HOME is not listed as an orphan. A malformed run record keeps its name listed until the record is removed.Tests
test/test_pod_windows.py::test_active_names_counts_a_boot_before_its_gateway_pid: a pod with only apreparingrun record and a live producer is listed, and is not once the producer is gone.-n0, andtest_pod_windows.pypassed in a shuffled order (68 passed, 2 skipped).Proof: PROVEN test/test_pod_windows.py::test_active_names_counts_a_boot_before_its_gateway_pid (head 0cd3b3d)
Manual verification
Still needed on a Windows host: start
kirocrew pod upon a worktree, and while it boots, confirm Remove on that worktree refuses. Not run here (Linux host); the unit test covers the listing.Screenshots / video
N/A — no frontend change.
Related Issues
Part of #27861
Sibling sweep
Swept: git grep -n "def active_names" -- src/kiro_crew/pod/
Sibling: src/kiro_crew/pod/launchd.py -- not changed here -- it lists a label whose process is live, and on macOS the boot runs as that job's process; not verified on a Mac.
Sibling: src/kiro_crew/pod/runtime.py -- not affected -- it dispatches to the per-platform function changed here on Windows.
Pattern harvest
Not generalizable: one Windows listing that read only the gateway pid record, while the boot record it already maintains marks the earlier phase; there is no repeatable code shape to lint for.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.