/self-hosted-runners:runner-healthfrom self-hosted-runners
Takes an operational health snapshot of a self-hosted GitHub Actions runner fleet using GitHub API, Docker, Lima VM, SSH, and optional Slack cross-check. Works even when the runner host is unreachable.
Ships in self-hosted-runners. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
/green drive)self-hosted-runner-preflight after this skill reports AMBER/RED.Each is a standalone bash script in scripts/ that outputs structured JSON to stdout.
| # | Script | What it checks | Failure mode (graceful) |
|---|---|---|---|
| 1 | check_api.sh | gh api orgs/$GH_ORG/actions/runners — 22-runner snapshot + busy count + in-flight jobs (per-repo) + rate limit | exits non-zero on API error; runner fleet unreadable |
| 2 | check_docker.sh | local docker ps for mac-side runners + AO auxiliaries | exits non-zero if Docker daemon is down |
| 3 | check_lima.sh | limactl list — colima VM status, SSH port, resources | exits non-zero if limactl missing |
| 4 | check_runner_host.sh | `ssh -o ConnectTimeout=5 "$RUNNER_HOST" 'uptime; df -h /home; free -h; DOCKER_HOST=$RUNNER_HOST_DOCKER_SOCK docker ps | wc -l'` |
| 5 | check_session_conflict.sh | For every GitHub-offline ezgha runner (mac or Linux fleet), cross-checks the local/SSH container state to distinguish session conflict (container Up, GitHub offline — stale registration lock; neither ezgha serve nor ezgha-watchdog detects this, since both only compare local managed-container counts) from ordinary runner_offline (container also down — ezgha will respawn it). Ported from closed PR #8033's check_github_session_state() / container_status_for() (bead rev-ws17d). | exits non-zero on gh api failure; JSON still emitted with error set |
| 6 | cross_check_hermes.sh | Posts thread to the cross-check channel and polls for reply (configurable wait) | exits non-zero if Slack MCP unavailable |
A runner container can show Up X minutes in docker ps (or over SSH into
the Linux runner host) while GitHub's API reports status:"offline". This divergence
is a triage signal, not a confirmed diagnosis — check_session_conflict.sh
proves the two states disagree (GitHub-offline + container-running), but it
never reads the container's Runner.Listener log, so it cannot itself
confirm the container is stuck in Runner connect error: Error: Conflict.
Treat every session_conflicts[] entry as "worth a human looking at the
listener log," not as "definitely a stale session." Neither ezgha serve's
own churn-replacement nor the ezgha-watchdog fleet-size check catches this
divergence class — both only compare a local managed-container count
against the configured target, and a session-conflicted container is still
alive and still counted as "managed" locally.
HUMAN-ONLY — do not automate. The remediation below is destructive (it
deletes the runner's GitHub registration and restarts its container,
interrupting any in-flight job on that runner). check_session_conflict.sh
itself stays strictly read-only — do not wire these commands into any
watchdog, cron, or auto-heal path. A human should confirm the
Runner.Listener log actually shows the conflict (or otherwise judge the
runner is safe to bounce) before running any of this by hand:
# Identify the conflicted runner (check_session_conflict.sh JSON: session_conflicts[])
RUNNER_ID=$(gh api orgs/$GH_ORG/actions/runners --jq '.runners[] | select(.name=="<name>") | .id')
gh api -X DELETE orgs/$GH_ORG/actions/runners/$RUNNER_ID
# Mac fleet (ez-mac-runner-*): docker restart <name>
# Linux fleet (ez-runner-*/ez-canary-runner-*): ssh "$RUNNER_HOST" "DOCKER_HOST=${RUNNER_HOST_DOCKER_SOCK:-unix:///var/run/docker.sock} docker restart <name>"
sleep 15
gh api orgs/$GH_ORG/actions/runners --jq '.runners[] | select(.name=="<name>") | {name, status, busy}'
A RED|SESSION CONFLICT: ... verdict from runner-health.sh takes priority
over the generic per-arch online-count verdict — see
parse_fields.py::compute_verdict. Runner naming note: ezgha rotates a
generation letter suffix on supervisor restart (observed live: b → c),
so check_session_conflict.sh matches on the stable ez-mac-runner- /
ez- prefixes only, never a hardcoded generation letter.
# Basic (no cross-check)
bash <skill-dir>/scripts/runner-health.sh
# With cross-check agent cross-check, 1 call
bash .../runner-health.sh --cross-check 1
# Cross-check max 3 calls (deep investigation)
bash .../runner-health.sh --cross-check 3
Output: console table + Markdown file at /tmp/runner-health-<ts>.md.
User runs /runner-health (or natural-language equivalent like "check runners"). The LLM:
Phase 1 — load context (optional but recommended):
memory-search skill with query "self-hosted runner the Linux runner host health check transient"history-search skill to find any prior runner-health invocations in the last 30 daysPhase 2 — run all 5 local checks in parallel (subagents or sequential bash):
bash <skill-dir>/scripts/check_api.sh
bash <skill-dir>/scripts/check_docker.sh
bash <skill-dir>/scripts/check_lima.sh
bash <skill-dir>/scripts/check_runner_host.sh
bash <skill-dir>/scripts/check_session_conflict.sh
Each produces JSON. The LLM parses + aggregates.
Phase 3 — synthesize verdict (GREEN/AMBER/RED) based on the JSON:
Session conflict (highest priority): if check_session_conflict.sh
reports any session_conflicts[], report RED — SESSION CONFLICT with
the affected runner name(s) and the manual-heal steps above instead of
the generic per-arch online-count framing below — ezgha serve /
ezgha-watchdog cannot fix this class.
Fleet shape (ezgha-managed, since 2026-07-06):
ez-runner-b-1..16) on the Linux runner host — managed by ezgha serve via systemd --userez-mac-runner-b-1..6) on the Mac host — managed by ezgha serve via launchdVerdict thresholds (per-arch, since ezgha):
| Verdict | Linux online | Mac online | Trigger |
|---|---|---|---|
| GREEN | ≥14 (healthy floor) | ≥5 (healthy floor) | Both hosts near full, no Docker restarts, all online runners busy=true |
| AMBER | 10–13 (supervisor stuck) | 4 (supervisor stuck) | One or both ezgha serve supervisors not replenishing — needs systemctl --user restart ezgha on Linux OR launchctl kickstart -k on Mac |
| AMBER | any | any | Docker restart loops detected |
| RED | <10 | any | ezgha serve on the Linux runner host critically stuck — restart required |
| RED | any | <4 | ezgha serve on Mac critically stuck — restart required |
| RED | <10 online + 0 busy | n/a | the Linux runner host host dark (three-signal: 0 Linux busy + linux_online <10 + SSH unreachable) — DO NOT restart containers, wait for host |
CRITICAL preflight rules:
linux_online (e.g. 16/16) with 0 busy + unreachable SSH is a healthy-but-idle fleet on a different wifi subnet, NOT host-dark — it falls through to the GREEN/AMBER verdict below.ezgha serve is alive (PID exists) and supervisor is just slow → AMBER, not RED. Restart supervisor to force-refill.ezgha status output on the suspect host BEFORE classifying as supervisor-stuck vs host-dark.Why per-arch instead of total: A single verdict line that says
"RED — 14/22 online" hides whether it's the Mac fleet or the Linux fleet
that's short. Naming the failing arch in the reason makes the fix
obvious — launchctl kickstart on Mac vs systemctl --user restart
on Linux.
Phase 4 — cross-check (only if user asks or AMBER detected):
bash .../cross_check_hermes.sh <0|1|2|3>
Posts to the cross-check channel thread ts (use existing thread or new one), polls for reply, parses response.
Phase 5 — write Markdown report:
bash .../runner-health.sh --write-report (or include in the master script by default)/tmp/runner-health-<unix-ts>.mdPhase 6 — present to user:
=== runner-health @ 2026-06-29 07:50 PDT ===
GitHub API: 22/22 runners online, 11/22 busy (8 Linux, 3 mac)
Docker: 6/6 mac Up, 0 stuck
Lima: colima running, 4GiB mem, 100GiB disk
the Linux runner host: unreachable from this host (different wifi subnet)
cross-check agent: cross-checked — 14/22 busy confirmed independently
VERDICT: GREEN — runners healthy, host just on different subnet
Host-dark example (two-signal confirmed, see preflight Class E):
=== runner-health @ 2026-07-02 09:10 PDT ===
GitHub API: 6/22 runners online (all 6 mac), 16/16 the Linux runner host Linux runners online=0/busy=0
Docker: 6/6 mac Up, 0 stuck
Lima: colima running, 4GiB mem, 100GiB disk
the Linux runner host: ssh timeout + ping timeout — both signals confirm host dark
VERDICT: RED — the Linux runner host host dark (16/16 Linux runners offline + SSH/ping timeout confirmed).
NOT a generic <22/22 — this is a single-host outage. See the fleet's host-freeze bead for tracking; do not open a new bead.
/tmp/runner-health-<ts>.md)# Runner Health Report — 2026-06-29 07:50 PDT
## Verdict: GREEN
## Check 1: GitHub API
| Metric | Value |
|---|---|
| Total runners | 22 |
| Online | 22 |
| Busy | 14 |
| Linux busy | 11 |
| mac busy | 5 |
| Rate limit (core) | 4284/5000 |
## Check 2: Docker (local)
| Container | Status |
|---|---|
| org-runner-mac-1..6 | Up |
| AO auxiliaries | 7/8 Restarting (1) (PR #702 fix pending) |
## Check 3: Lima VM
| Field | Value |
|---|---|
| Name | colima |
| Status | Stopped |
| CPUS | 4 |
| Memory | 4GiB |
| Disk | 100GiB |
## Check 4: the Linux runner host
| Field | Value |
|---|---|
| Reachable | No (different wifi) |
| Subnet | <runner-host-subnet> |
| Recommendation | Check router DHCP lease for new IP |
## Check 5: Session conflict (GitHub offline vs container Up)
| Field | Value |
|---|---|
| Offline count | 0 |
| Session conflicts | none |
## Check 6: cross-check agent cross-check
(only if invoked)
## Notes
- PR #702 (AO spawn fix) not yet merged — bake-in bug recurs every ~1h
- 4 PRs open as DRAFT: #702, #8039, #8040, #8041
runner-health.sh runs all + writes report--cross-check=<0|1|2|3>/tmp/ (clears on reboot; user can persist by copying elsewhere)self-hosted-oss/ is retired (removed by PR #8057 and its cleanup follow-up) — do not reference or resurrect it. Runner-fleet changes now go through the ez-gh-actions ("ezgha") daemon / self-hosted-colima/scripts/; see ezgha-watchdog and self-hosted-runner-preflight for that territory.~/.local/share/runner-health/ — this skill is stateless by design.scripts/check_api.sh (opens in a new tab)scripts/check_docker.sh (opens in a new tab)scripts/check_lima.sh (opens in a new tab)scripts/check_runner_host.sh (opens in a new tab)scripts/check_session_conflict.sh (opens in a new tab)scripts/cross_check_hermes.sh (opens in a new tab)scripts/parse_fields.py (opens in a new tab)scripts/runner-health.sh (opens in a new tab)scripts/test_check_api.sh (opens in a new tab)scripts/test_check_session_conflict.sh (opens in a new tab)scripts/test_parse_fields.py (opens in a new tab)scripts/test_read_json_or_default.sh (opens in a new tab)tests/fixtures/api_3L1M_busy.json (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub jleechanorg/jleechan-skills --plugin self-hosted-runners4 skills in this plugin
/ezgha-watchdogRead-only fleet-size consumer for the 6 mac + 16 linux ezgha runner invariant. Restart-only remediation is UNAVAILABLE (fail-closed) pending the ezgha upstream repository (`$EZGHA_UPSTREAM_REPO`) PR 67 (dual-Lima convergence) and PR 70/issue 60 (recovery controller) merging AND being proven live-deployed — a 2026-07-09..11 audit found restarts can kill active jobs, create offline-busy 422 registrations, and cannot repair a dead/wrong-namespace backend. Use when the user says "make sure we have N mac and M linux runners", "ezgha fleet short", "supervisor stuck", or after any /runner-health AMBER/RED verdict — but diagnose with ez-gh-actions' doctor-runner first, never treat a shortfall as expected churn./repo-and-infra-locationsTemplate for looking up this machine's repository checkouts, ao CLI build path, AO YAML config rules, port assignments, and Hermes edit rules from machine-local configuration/self-hosted-runner-preflightPre-flight checklist for self-hosted runner failures. Use when investigating low disk, missing runner, or stuck Green Gate on the $GITHUB_REPOSITORY fleet. Always verifies host-level container state, not just GitHub API.