Skip to content

Capture agent exit codes for post-mortem diagnostics#44

Merged
selfcontained merged 1 commit into
mainfrom
fix/tmux-exit-capture
Mar 12, 2026
Merged

Capture agent exit codes for post-mortem diagnostics#44
selfcontained merged 1 commit into
mainfrom
fix/tmux-exit-capture

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Wraps tmux session agent commands in bash -c to capture the exit code to /tmp/dispatch_<session>.exit when the agent process terminates
  • Reconciliation reads the exit file and logs the exit code, surfacing it in the agent's latest event message and metadata
  • Adds .media to .gitignore for local dev media directories

Context

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 passes
  • npm test — 25/25 unit tests pass
  • npm run test:e2e — 23/23 e2e tests pass (against dev server with fresh web build)

🤖 Generated with Claude Code

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]>
@selfcontained
selfcontained merged commit 6b50368 into main Mar 12, 2026
1 check passed
@selfcontained
selfcontained deleted the fix/tmux-exit-capture branch March 12, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant