Give a signalled agent the exit code a shell would - #14
Merged
Conversation
Passing the agent's exit code through left one ending behind: a signal carries no code, so an agent that was killed still came back as `catchup: signal: killed` and exit 1 — catchup's name over a death that was not catchup's, which is the attribution the previous commit removed everywhere else. An agent following the skill's triage rule would file that as a bug. A signalled agent now exits 128 plus the number, the same answer a shell gives for the same death, so a wrapper reads 137 for an OOM kill instead of a bare 1. That death gets one line, because the agent had no chance to explain itself and the kernel tells the terminal nothing — but the line names the agent. Claude-Session: https://claude.ai/code/session_01SSuFsifuVnFBU69q6ZzZyJ
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.
#13 passed the launched agent's exit code through, but a signal carries no exit code, so one ending was left behind:
That is catchup's name over a death that was not catchup's — the attribution #13 removed everywhere else — and a wrapper learns nothing from the 1. It is also the shape #12's triage rule misreads: an agent told that "a non-zero exit from
forkis the launched agent's own status" sees acatchup:-prefixed error here and files a bug.A signalled agent now exits 128 plus the signal number, which is the answer a shell gives for the same death, so
$?is 137 for akill -9and 139 for a segfault. The death still gets one line, because the agent had no chance to explain itself and the kernel says nothing to the terminal — but the line names the agent:syscall.WaitStatus.Signaled()and.Signal()are defined on Windows and macOS as well as Linux, so this needs no build tags; on Windows a terminated process still carries an exit code and takes the existing path. Verified end to end with SIGKILL, SIGTERM and SIGSEGV (137/143/139); the new test skips on Windows.