Repository navigation
fix(diagnostics): retain root exit facts at probe timeout - #552
Merged
Merged
Conversation
stamp-build
Bot
force-pushed
the
agent/otter/probe-exit-diagnostics
branch
from
October 30, 2026 13:22
35ed58d to
245c957
Compare
stamp-build Bot
added a commit
that referenced
this pull request
Oct 30, 2026
<!-- stamp:review:v1 --> <sup><img src="https://cdn.slock.ai/avatars/6aabf32c-20bc-4cba-b55a-2aa72b60999b/8ba4452ceb890f1930886ef4286fdb99.webp" width="16" height="16" align="absmiddle" alt=""> <b>Otter</b> from open-agent-runtime opened this pull request through Stamp</sup><br><sup><a href="https://stamp.build/review?receipt=prc_3dd8b04ccc82e063671c93b204cfab1b"><picture><source media="(prefers-color-scheme: dark)" srcset="https://stamp.build/assets/brand/stamp-glyph-dark.d907ffcadb44.svg"><img src="https://stamp.build/assets/brand/stamp-glyph-light.58a2c10ed108.svg" width="13" height="12" align="absmiddle" alt=""></picture> View in Stamp →</a></sup> --- <!-- /stamp:review:v1 --> The Windows CI monitor called `Process.Kill(true)` synchronously after a case or command deadline. If that call did not return, the monitor could not exit and reach the artifact upload step. Run termination on a background worker and bound the total termination wait to ten seconds. A returned call retains a root-exit observation of up to five seconds within the remaining budget; a nonreturning or thrown call records its own checkpoint. All timeout paths flush the final `stage_exit` record and exit 124 without joining the worker, disposing the shared process, or taking another CIM sample. Normal commands retain their native exit codes and inherited output. Exit 124 does not claim that every descendant stopped; residual cleanup belongs to the runner. The actual termination helper has real-child regressions for native termination, a never-returning call, an exception, and a slow returned call whose target remains alive. They observe root `exit` separately from pipe `close`, enforce the total budget, retain evidence in both sinks and clean up the synthetic targets. The existing command and blocked-worker assertions remain, with the final stage checkpoint now also checked in stdout. Validation and evidence: - `CI=1 pnpm run check` with PowerShell 7.6.9 enabled: 2,523 tests, including the four actual-helper cases, and 18 mock behavior cases passed. - Two Windows investigation runs are preserved in `experiments/windows-handles/README.md`, with repeatable scripts. The second run passed: inherited handles delayed the next step 5533 ms versus 488 ms with files; injected nonreturning termination waited 10005 ms and the root exited 124 another 99 ms after its checkpoint while the target and pipes were still alive. - The first collector's failure is retained: it awaited `close`, so it could not determine whether the root was still alive. The second collector records `exit` and `close` independently. - The investigation workflow replacement is excluded from this PR. Normal CI configuration, command concurrency, test assertions and native deadlines are unchanged. Windows integration confirmation will come from this PR's checks. This is task #97. The old 25-minute cancellations remain unexplained; this change bounds one monitor operation and improves evidence retention without claiming a causal fix or guaranteed upload if the runner itself fails. Product probe diagnostics are separate in PR #552. Co-authored-by: Otter <[email protected]>
stamp-build
Bot
force-pushed
the
agent/otter/probe-exit-diagnostics
branch
from
October 30, 2026 16:08
245c957 to
4a51fae
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A one-shot CLI probe can time out after its root process has already exited because a descendant still holds stdout or stderr. The previous diagnostic did not distinguish that case from a root that had not emitted
exit.Capture the root's observed exit time, elapsed duration, code and signal, plus whether
closehas arrived, when the deadline fires and before cleanup. Preserve that snapshot in the failure cause and readable error. Return semantics, default and explicit deadlines, cancellation, pipe draining and process cleanup are unchanged. This adds evidence for task #97; it does not identify the cause of historical CLI timeouts.Validation:
CI=1 pnpm run check: 2,520 tests and 18 mock behavior cases passed.The separate Windows handle experiment is recorded in task #97 (run 41030609576); the CI monitor change is a separate pull request. This change belongs after 0.79.0.