Capture agent exit codes for post-mortem diagnostics#44
Merged
Conversation
Wrap tmux session commands in bash to write the agent process exit code to /tmp/dispatch_<session>.exit on termination. Reconciliation reads this file to log and surface the exit code in the agent's latest event. Also adds .media to .gitignore for local dev media directories. Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
bash -cto capture the exit code to/tmp/dispatch_<session>.exitwhen the agent process terminates.mediato.gitignorefor local dev media directoriesContext
When the only running agent process exits (for any reason), the tmux server shuts down since there are no remaining sessions. Previously there was no way to determine why the agent exited — the session and its output were gone. This change preserves the exit code for post-mortem investigation without altering the existing session lifecycle.
Test plan
npm run check— type checking passesnpm test— 25/25 unit tests passnpm run test:e2e— 23/23 e2e tests pass (against dev server with fresh web build)🤖 Generated with Claude Code