Skip to content

Spawn diagnosis agent via tmux when deploy/rollback fails#11

Merged
selfcontained merged 1 commit into
mainfrom
feature/deploy-diagnosis-agent
Mar 10, 2026
Merged

Spawn diagnosis agent via tmux when deploy/rollback fails#11
selfcontained merged 1 commit into
mainfrom
feature/deploy-diagnosis-agent

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds spawn_diagnosis_agent() to bin/dispatch-deploy that launches a claude CLI session in tmux when the deploy pipeline fails — bypassing the server API which may be down
  • Pre-registers the agent in PostgreSQL so reconcileAgents() picks it up when the server recovers
  • Called at all 3 failure exit points: build failure, health check with no rollback, and deploy+rollback both failed
  • Also fixes DISPATCH_BIN_DIR placeholder in server .env and restores the launchd service (server was down after a failed v0.1.3 release)

Test plan

  • Server health verified: curl -fsS http://127.0.0.1:6767/api/v1/health returns ok
  • UI serves at :6767 (200 text/html)
  • bash -n bin/dispatch-deploy passes syntax check
  • Dry-run test confirms agent ID generation, port resolution, bin dir, and DB URL all resolve correctly

🤖 Generated with Claude Code

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]>
@selfcontained
selfcontained merged commit 0eed118 into main Mar 10, 2026
1 check passed
@selfcontained
selfcontained deleted the feature/deploy-diagnosis-agent branch April 9, 2026 03:01
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