Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ Orchestration agents can create drafts in `draft/` for reusable parallel process
| Security | `tools/security/tirith.md` (terminal guard), `tools/security/shannon.md` (pentesting) |
| Cloud GPU | `tools/infrastructure/cloud-gpu.md` |
| Parallel agents | `tools/ai-assistants/headless-dispatch.md`, `tools/ai-assistants/runners/` |
| Orchestration | `supervisor-helper.sh` (batch dispatch, cron pulse, self-healing) |
| Orchestration | `supervisor-helper.sh` (batch dispatch, cron pulse, self-healing), `/runners-check` (quick queue status) |
| MCP dev | `tools/build-mcp/build-mcp.md` |
| Agent design | `tools/build-agent/build-agent.md` |
| Framework | `aidevops/architecture.md` |
Expand Down
56 changes: 56 additions & 0 deletions .agents/scripts/commands/runners-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
description: Quick health check of supervisor batch queue, workers, PRs, and system resources
agent: Build+
mode: subagent
---

Quick diagnostic of the supervisor queue. Shows batch status, stuck tasks, open PRs, and issues.

Arguments: $ARGUMENTS

## Steps

Run these commands in parallel and present a unified report:

```bash
# 1. Active batch status
~/.aidevops/agents/scripts/supervisor-helper.sh status 2>&1

# 2. Open PRs from workers (need merge/review)
gh pr list --state open --json number,title,headRefName,createdAt,statusCheckRollup \
--jq '.[] | "\(.number) [\(.headRefName)] \(.title) checks:\(.statusCheckRollup | map(.conclusion // .state) | join(","))"' 2>/dev/null

# 3. Active worktrees (worker sessions)
git worktree list 2>/dev/null

# 4. System resources
~/.aidevops/agents/scripts/supervisor-helper.sh db \
"SELECT id, state, retries FROM tasks WHERE state NOT IN ('deployed','cancelled','failed') ORDER BY state;" 2>/dev/null
```

## Report Format

Present results as a concise dashboard:

### Batch Status

Check notice on line 35 in .agents/scripts/commands/runners-check.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/scripts/commands/runners-check.md#L35

Expected: 1; Actual: 0; Below
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdown heading format (MD022 violations).

Headings should be surrounded by blank lines. Add a blank line before each of these h3 headings:

📝 Proposed fix for markdown formatting
 Present results as a concise dashboard:
+
 ### Batch Status
 - Batch name, total/completed/queued/running/failed counts
 - Any tasks stuck in retrying or evaluating for >10 minutes
+
 ### Action Items
 Flag these for the user (most important first):
 1. **PRs ready to merge** — all CI green, no review comments
 2. **PRs with CI failures** — need investigation
 3. **Tasks stuck** — in retrying/evaluating too long
 4. **Tasks at max retries** — need manual intervention or re-queue
 5. **Stale worktrees** — for tasks already deployed/merged
+
 ### System Health
 - Load, memory, worker count
 - Cron pulse status: `~/.aidevops/agents/scripts/supervisor-helper.sh cron status 2>&1`

Also applies to: 39-39, 47-47

🧰 Tools
🪛 GitHub Check: Codacy Static Code Analysis

[notice] 35-35: .agents/scripts/commands/runners-check.md#L35
Expected: 1; Actual: 0; Below

🪛 markdownlint-cli2 (0.20.0)

[warning] 35-35: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)

🤖 Prompt for AI Agents
In @.agents/scripts/commands/runners-check.md at line 35, Add a blank line
immediately before each level-3 heading (the lines starting with "###") so
headings like "### Batch Status" and the other h3 headings referenced are
surrounded by a blank line above them to satisfy MD022; update every "###"
heading in the document accordingly.

- Batch name, total/completed/queued/running/failed counts
- Any tasks stuck in retrying or evaluating for >10 minutes

### Action Items

Check notice on line 39 in .agents/scripts/commands/runners-check.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/scripts/commands/runners-check.md#L39

Expected: 1; Actual: 0; Below
Flag these for the user (most important first):
1. **PRs ready to merge** — all CI green, no review comments
2. **PRs with CI failures** — need investigation
3. **Tasks stuck** — in retrying/evaluating too long
4. **Tasks at max retries** — need manual intervention or re-queue
5. **Stale worktrees** — for tasks already deployed/merged

### System Health

Check notice on line 47 in .agents/scripts/commands/runners-check.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.agents/scripts/commands/runners-check.md#L47

Expected: 1; Actual: 0; Below
- Load, memory, worker count
- Cron pulse status: `~/.aidevops/agents/scripts/supervisor-helper.sh cron status 2>&1`

## Arguments

- No arguments: check the most recent active batch
- `--batch <id>`: check a specific batch
- `--all`: show all batches including completed
- `--fix`: auto-fix simple issues (merge green PRs, clean stale worktrees, reset stuck tasks)
Loading