Repository navigation
fix(pod): show only the current start's log in a Windows boot failure - #21729
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing to check. [DESIGN-REVIEWED] 5c9204e Description read[DESCRIPTION-READ] 85df9ae3a5a6aa0bb54f6488a68c8cefc4bc2c1fa572a920ef2d984f1afbf684 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 Check that #21731 covers the macOS What this change shipsInventory (5 items) — 5 justifiedIntent: when a Windows
[FIRST-PRINCIPLES-REVIEWED] 5c9204e Description read[DESCRIPTION-READ] c5b467f20b19b62e2e36689415e424ebbcfd0b3aba40c9ec15e05bbae38f2540 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: |
The Task Scheduler wrapper appends every boot to the same pod.out.log and pod.err.log. A failed pod up printed their tail, so a start that wrote nothing (a hard kill before the claim) showed an earlier start's FATAL as its cause. pod up now marks both files' size just before start_pod and reads only what was written after that mark. Earlier output stays in pod logs. The refusal itself is unchanged. Closes #21571
1d60793 to
5c9204e
Compare
|
|
|
Deferral accepted by the operator (bolichen): First Principles Item 1 (span=b7ea14c1567c, launchd and journalctl siblings) is out of this PR's Windows scope and is tracked in #21731 (Due: 2026-10-31). |
iamwhatever
left a comment
There was a problem hiding this comment.
APPROVE at 5c9204e.
The fix targets the real cause: the Task Scheduler wrapper appends every boot to the same pod.out.log / pod.err.log, and the failure report tailed the whole file. pod up now records both sizes right before start_pod (cli.py#L610), and the failure tail reads only bytes past that mark (windows.py#L1278-L1340). An already-running pod, other platforms and pod logs keep the whole-file read. A shrunk file is read whole, and a start that wrote nothing points to kirocrew pod logs. The new Windows tests include a negative control, so they would catch the old behaviour.
The launchd and journalctl siblings are deferred to #21731. I checked that issue: it carries the deferred-finding label, an assignee and a due date, and it names both tasks. Every AI lane on this head is PASS or no findings. All checks on this head are green with nothing pending, and no review requests changes.
— crew-pr-reviewer (r110)
Problem / Motivation
Goal: When a Windows
pod upfails, its report shows only what this start wrote, never an earlier start'sFATAL.On Windows, a pod hard-killed before its supervisor claim (case C of #10998) is refused by
pod upandpod down. That refusal is correct. But the journal tail printed above it carriedFATAL: no built distfrom an earlier failed start. It reads like the cause of this refusal, and it is not.Why it matters
A Windows operator reading that report fixes a dist that is already fine, instead of following the manual retirement the refusal points to.
Not a goal
pod logskeeps them.What changed (motivation → approach → change)
Symptom: the failure tail of
pod upshows a FATAL line from a previous boot.Root cause: the Task Scheduler
.cmdwrapper appends (>>) every boot to the samepod.out.log/pod.err.log, andrecent_journaltails the whole file.Change:
pod uprecords both files' sizes (journal_mark) right beforestart_pod. On failure it reads only bytes written after that mark (recent_journal(..., since=mark)). A start that wrote nothing says so and points tokirocrew pod logs. A log that shrank since the mark is read whole. Without a mark (an already-running pod, other platforms) the tail is read exactly as before. Files:src/kiro_crew/pod/windows.py(journal_mark,since),src/kiro_crew/pod/runtime.py(dispatch),src/kiro_crew/pod/cli.py(mark beforestart_pod),src/kiro_crew/pod/README.md(one note).Backwards compatibility
Compatible:
sinceis an optional argument; every existing caller and non-Windows path reads the same tail as before.Removes nothing: no log, file, key or function is removed; earlier output stays on disk and in
pod logs.Tests
test/test_pod_windows.py:test_journal_since_mark_leaves_out_an_earlier_starts_fatal(with a negative control: the same files read without a mark still show the stale FATAL),test_journal_since_mark_keeps_this_starts_fatal,test_journal_mark_of_absent_logs_reads_a_first_start_whole,test_journal_since_mark_reads_a_replaced_file_whole,test_runtime_threads_the_journal_mark_to_the_windows_backend,test_journal_mark_is_none_off_win32.test/test_pod_health_wait.py:test_failure_journal_is_read_from_this_starts_mark(mark taken beforestart_podand passed to the tail read),test_failure_journal_of_a_running_pod_is_the_whole_tail.recent_journalintest/test_pod.py,test/test_pod_launchd.py,test/test_pod_health_wait.pyandtest/test_pod_windows.pyaccept the newsincekeyword: callers always pass it (Nonemeans the whole tail).6ed866fdfa, the 8 new tests fail; with the fix they pass. They use onlytmp_pathfiles and monkeypatched stubs: no clock, no sleep, no shared state.Manual verification
Native Windows Server 2025 (build 26100), Python 3.12.10, isolated pod plane (own
KIROCREW_HOME, pod root, env dir, task prefix, base port), on the same diff over8c4a3d9bce(the pod files are unchanged between that and this base):FATAL: no built distno pod log from this start ... Earlier starts' output is in kirocrew pod logs; refusal text unchangedFATAL: no built distshownuphealth=200,downzero residueThe test task, its folder and the plane were removed afterwards.
Related Issues
Closes #21571
Related: #10998, #21580 (alternative approach: deletes both logs before each start)
Pattern harvest
Rule candidate: review-prompt
Pattern: a failure report that tails an append-only log must bound the read to the current attempt (offset, run id or timestamp), or an earlier run's error reads as this run's cause.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)