Pass the launched agent's exit code through - #13
Merged
Merged
Conversation
fork hands the terminal to another program, but its exit status stopped at catchup: every failure was reported as `catchup: exit status 3` and flattened to exit 1. A wrapper could not tell an agent that failed from a catchup that did, and an agent reading the message had no way to know the fault was not catchup's — the one failure shape catchup manufactures for itself. A clean non-zero exit now travels out as ExitError and main exits with that number, unannounced: the agent owns the terminal and has already said whatever it meant to. Failing to launch at all keeps its own message, because nothing ran to have a status. 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.
catchup forkreplaces this terminal's occupant with another agent, but that agent's exit status stopped at catchup. A shim exiting 3 produced:Two things were wrong with that. A script wrapping
catchup forkcould not tell an agent that failed from a catchup that did — every outcome was 1. And thecatchup:prefix put the blame on catchup for a program it had merely started, which matters now that the skill asks agents to triage catchup failures and report the unexpected ones:exit status 3names no recovery and matches none of the known-local categories, so it reads as a catchup bug.A clean non-zero exit now travels out as
cli.ExitErrorandmainexits with that number and prints nothing — the agent owns the terminal and has already said whatever it meant to. Failing to launch at all is unchanged and still catchup's to report, because nothing ran to have a status:Verified end to end on both paths with an agent that exits 3: native
fork claudeandfork claude --into codexeach return 3 with no added line, andPATH=/nonexistentstill returns 1 with the not-found message.