Skip to content

Add periodic agent status reconciliation#35

Merged
selfcontained merged 1 commit into
mainfrom
fix/agent-status-reconciliation
Mar 11, 2026
Merged

Add periodic agent status reconciliation#35
selfcontained merged 1 commit into
mainfrom
fix/agent-status-reconciliation

Conversation

@selfcontained

Copy link
Copy Markdown
Owner

Summary

  • Adds reconcileAgentStatuses() method to AgentManager that queries agents with active statuses (running, stopping, creating), checks if their tmux session still exists, and corrects orphaned agents to stopped status with an appropriate latest event.
  • Wires up a 30-second setInterval in server.ts that runs reconciliation and publishes SSE agent.upsert events for any corrected agents so the UI updates in real time.
  • Cleans up the interval on server shutdown.

Test plan

  • Verify type check passes (npm run check)
  • Start an agent, kill its tmux session manually (tmux kill-session -t <session>), and confirm the agent transitions to stopped within 30 seconds
  • Confirm the UI reflects the status change via SSE without a page refresh
  • Verify agents already in stopped/error status are not touched

🤖 Generated with Claude Code

Adds a 30-second interval that detects agents stuck in running/stopping/creating
status when their tmux session no longer exists, corrects them to stopped, and
publishes SSE events so the UI updates immediately.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@selfcontained
selfcontained merged commit 2af94de into main Mar 11, 2026
1 check passed
@selfcontained
selfcontained deleted the fix/agent-status-reconciliation branch March 11, 2026 14:29
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