Repository navigation
fix(pod): stop the pod up wait when this start's boot refuses - #21831
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Before merge, check that [DESIGN-REVIEWED] 48f1078 Description read[DESCRIPTION-READ] f6a2337ee3fe36591931e042ecb9b557150fe278ce607330d817ab8fd2e99360 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 Before merge, confirm on a real Mac that a forced Not justified as shipped
What this change shipsInventory (6 items) — 4 justifiedIntent: when a pod's boot refuses,
[FIRST-PRINCIPLES-REVIEWED] 48f1078 Description read[DESCRIPTION-READ] dc88041035b2224c76b230b33b33d0989313401df013b626f69d1548d93fa4ae 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: |
e62b000 to
a3eb149
Compare
a3eb149 to
48f1078
Compare
|
|
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Tier 1 auto-approve: fix (2 files). Criteria: no conflict, no requested changes, security path denylist clean, design-doc gate clean, security checklist all-NO, no reviewer-lane findings, readiness signal fresh for this head SHA, declared category matches the diff. Category: pod up stops its health wait when the boot it started records a refusal, instead of running out the budget; tests cover stale and cleared notes.
Problem / Motivation
Goal: When a pod's boot refuses,
kirocrew pod upstops right away and prints the refusal's reason, instead of waiting out its budget and calling the pod "still starting".On macOS, a boot that refuses (for example a symlink planted at the pod's
os-home) records why in<name>.refusedand exits 0, so launchd does not restart it.pod upthen waited the whole 90s budget and saidgateway still starting after 90s ... (process alive; ...), which is false: the boot had already quit. Found on a real Mac while verifying #21793.Why it matters
Anyone whose pod refuses to boot on macOS waits 90s for nothing and is told to raise the wait budget, which can never help. On Linux and Windows the wait already stops early, but the message blames "the worktree build", which is also not the cause.
Not a goal
pod upverdict.What changed (motivation → approach → change)
pod upwaited 90s after a macOS boot refusal and blamed a slow boot. The wait insrc/kiro_crew/pod/cli.pyonly looked at the port and the unit state, and a refusal that exits 0 leaves the unit looking clean. The note the boot writes was never read.pod upnow records the refusal note's identity (inode, mtime, size, vialstat) just before it starts the pod. While waiting, a note that exists and differs from that record means this start refused, so the wait ends at once with a newHEALTH_BOOT_REFUSEDverdict. An earlier boot's note, a note a later boot cleared, or a pod this command did not start never trigger it.pod upthen printsthe pod's boot refused and exited: <recorded reason>, read before any teardown, plus a line pointing atkirocrew pod ls, which shows the same note. It records the failure in the audit log asboot refused, like the otherpod upfailure verdicts.Backwards compatibility
Compatible: the wait gains an optional
refusal_markargument that defaults to the old behaviour, and the new verdict only fires on a refusal note this start wrote.Removes nothing: no path, key, record or verdict is taken away; one verdict is added.
Tests
In
test/test_pod_health_wait.py:test_a_refusal_written_during_the_wait_ends_it_earlyinactivelike launchd after an exit 0test_an_earlier_boots_note_does_not_end_the_waittest_a_note_this_boot_cleared_is_not_a_refusaltest_without_a_mark_the_note_is_never_readtest_the_refused_sentinel_collides_with_no_siblingtest_a_refused_boot_reports_its_recorded_reasonpod upprints the reason, not "still starting" or "worktree build", and still stops the unit it startedtest_up_stamps_the_refusal_note_before_the_startstart_podand reaches the waitRed on the parent: with the new check in the wait disabled,
test_a_refusal_written_during_the_wait_ends_it_earlyfails. Determinism: the 7 new tests passed 10 repeated runs, a reversed order and a parallel run (-n 4). They use the wait's privateManualClockand a temp HOME.Manual verification
N/A for this head: the bug was reproduced on a real Mac (forced refusal via a symlinked pod
os-home, recorded on #21793), and unit tests cover the wait and the verdict on every backend. A re-run on a Mac after merge would confirmpod upnow exits within a second of the refusal.Related Issues
Closes #21824
Pattern harvest
Rule candidate: review-prompt
Pattern: a wait loop that infers failure only from a supervisor's state misses a child that records its failure in a side file and exits 0
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)