Spawn diagnosis agent via tmux when deploy/rollback fails#11
Merged
Conversation
When dispatch-deploy fails (build, health check, or rollback), the server may be down so the API-based agent spawn is unavailable. This adds a spawn_diagnosis_agent() function that launches claude CLI directly in a tmux session — pre-registering in PostgreSQL so reconcileAgents() picks it up when the server recovers. 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
spawn_diagnosis_agent()tobin/dispatch-deploythat launches aclaudeCLI session in tmux when the deploy pipeline fails — bypassing the server API which may be downreconcileAgents()picks it up when the server recoversDISPATCH_BIN_DIRplaceholder in server.envand restores the launchd service (server was down after a failed v0.1.3 release)Test plan
curl -fsS http://127.0.0.1:6767/api/v1/healthreturns ok:6767(200 text/html)bash -n bin/dispatch-deploypasses syntax check🤖 Generated with Claude Code