Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix(ops-dash): run the CI probe in parallel so the dashboard renders inline (#1002)

Aurora Capital9c9422ac89b2
diff --git a/claude-ops/bin/ops-dash b/claude-ops/bin/ops-dash
index 730119d7..2b7ca289 100755
--- a/claude-ops/bin/ops-dash
+++ b/claude-ops/bin/ops-dash
@@ -258,17 +258,28 @@ TOTAL_PROBES=13
# 3) CI failures (via registry repos) + merged PR sparkline (GraphQL)
(
- # CI fails: iterate registry repos with gh run list --repo (works outside git cwd)
+ # CI fails: one gh call per registry repo, in parallel. In series this was the
+ # slow probe (45s of a 56s render) and the dashboard never reached the screen.
+ # Each repo writes its own count; a repo that does not answer within 8s counts
+ # as 0 rather than holding the render. The count is unchanged: failures among
+ # the last 10 runs.
FAIL_COUNT=0
if [ -f "$REGISTRY" ] && command -v gh &>/dev/null; then
# Schema-tolerant: GSD registry has no .repos[]; derive slugs from .remote_url.
# `|| true` preserves set -e guard so the probe still touches done_ci on jq error.
REPOS=$(ops_registry_repos "$REGISTRY" || true)
+ CI_I=0
for repo in $REPOS; do
- C=$(gh run list --repo "$repo" --limit 10 --json conclusion 2>/dev/null \
- | jq '[.[] | select(.conclusion == "failure")] | length' 2>/dev/null || echo "0")
- FAIL_COUNT=$((FAIL_COUNT + C))
+ CI_I=$((CI_I + 1))
+ (
+ C=$(timeout 8 gh run list --repo "$repo" --limit 10 --json conclusion 2>/dev/null \
+ | jq '[.[] | select(.conclusion == "failure")] | length' 2>/dev/null || echo "0")
+ case "$C" in ''|*[!0-9]*) C=0 ;; esac
+ echo "$C" > "$TMPDIR_DASH/ci_fail_$CI_I"
+ ) &
done
+ wait
+ FAIL_COUNT=$(cat "$TMPDIR_DASH"/ci_fail_* 2>/dev/null | awk '{s+=$1} END {print s+0}')
fi
echo "$FAIL_COUNT" > "$TMPDIR_DASH/ci_fails"
diff --git a/claude-ops/tests/run-all.sh b/claude-ops/tests/run-all.sh
index bc6acd09..3dd39120 100755
--- a/claude-ops/tests/run-all.sh
+++ b/claude-ops/tests/run-all.sh
@@ -95,6 +95,7 @@ run_suite "$TESTS_DIR/test-cloudflare-dns-lib.sh"
run_suite "$TESTS_DIR/test-ops-dns-provision.sh"
run_suite "$TESTS_DIR/test-ops-marketing-dash-brand-isolation.sh"
run_suite "$TESTS_DIR/test-ops-dash-portfolio-counts.sh"
+run_suite "$TESTS_DIR/test-ops-dash-ci-probe.sh"
run_suite "$TESTS_DIR/test-ops-release-changelog-heading.sh"
run_suite "$TESTS_DIR/test-ops-release-pr-sweep.sh"
run_suite "$TESTS_DIR/../templates/statusline/tests/run-tests.sh"
diff --git a/claude-ops/tests/test-ops-dash-ci-probe.sh b/claude-ops/tests/test-ops-dash-ci-probe.sh
new file mode 100644
index 00000000..390f05c1
--- /dev/null
+++ b/claude-ops/tests/test-ops-dash-ci-probe.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# The CI probe used to walk every registry repo in series with no time limit.
+# One slow `gh` held the whole dashboard: measured 45s of a 56s render, which
+# pushed the render past the inline threshold so it landed as a background task
+# instead of on screen. The probe must fan out and must give up on a repo.
+set -euo pipefail
+
+PLUGIN_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+DASH="$PLUGIN_ROOT/bin/ops-dash"
+
+fail=0
+
+# The per-repo count still has to be exactly the old one: failures among the
+# last 10 runs. A broader query would change the number the dashboard shows.
+if ! grep -Fq 'gh run list --repo "$repo" --limit 10 --json conclusion' "$DASH"; then
+ echo "FAIL: CI probe no longer counts failures in the last 10 runs per repo"
+ fail=1
+fi
+
+# Serial is the bug. The gh call has to sit inside a subshell that is
+# backgrounded, so the next repo starts before this one returns.
+if ! grep -A6 -F 'gh run list --repo "$repo"' "$DASH" | grep -Eq '^[[:space:]]*\) &'; then
+ echo "FAIL: the per-repo gh call is not in a backgrounded subshell"
+ fail=1
+fi
+
+# A repo that never answers must not hold the render. Bound the call.
+if ! grep -Eq 'timeout [0-9]+ gh run list' "$DASH"; then
+ echo "FAIL: CI probe has no timeout on gh run list"
+ fail=1
+fi
+
+# The count is a sum. Parallel workers have to write their own number and be
+# added afterwards, or two repos clobber one counter.
+if ! grep -Fq 'ci_fail_' "$DASH"; then
+ echo "FAIL: CI probe has no per-repo result file to sum"
+ fail=1
+fi
+
+[ "$fail" -eq 0 ]
+echo "PASS: ops-dash CI probe fans out and times out"