diff --git a/plugins/tend-ci-runner/skills/review-runs/SKILL.md b/plugins/tend-ci-runner/skills/review-runs/SKILL.md index 2db2fa88..94ac06c1 100644 --- a/plugins/tend-ci-runner/skills/review-runs/SKILL.md +++ b/plugins/tend-ci-runner/skills/review-runs/SKILL.md @@ -131,7 +131,12 @@ List tend CI runs that completed in the past 24 hours (the cron runs daily): ```bash REPO=$(gh repo view --json nameWithOwner --jq '.nameWithOwner') SINCE=$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ) -for workflow in $(gh api repos/$REPO/actions/workflows --jq '.workflows[] | select(.name | startswith("tend-")) | .id'); do +# Add the repo's extra prefixes from its `running-tend` skill: any workflow +# running the tend action is in scope, not just the generated `tend-*` ones. +# Step 2 prices the same list. +PREFIXES=("tend-") +PREFIX_RE="^($(IFS='|'; echo "${PREFIXES[*]}"))" +for workflow in $(gh api repos/$REPO/actions/workflows --jq ".workflows[] | select(.name | test(\"$PREFIX_RE\")) | .id"); do gh api "repos/$REPO/actions/workflows/$workflow/runs?created=>=$SINCE&status=completed" \ --jq '.workflow_runs[] | {databaseId: .id, conclusion, createdAt: .created_at, name: .name}' done @@ -144,7 +149,7 @@ Then, for each run ID from above, pull its jobs and classify them: - **Long-running** (>30 min): Tend runs typically finish in single-digit minutes. Anything over 30 is worth a look — download session logs in Step 3 and diagnose where the time went (long background waits, push-wait-fix cycles, a stuck tool call). - **Near-timeout** (within 90% of the cap): A job that consumed most of its timeout budget is one slow external check away from being killed. These are **structural** failures: one occurrence is enough to act on. -To determine the timeout cap for a workflow, read `timeout-minutes` from the workflow YAML file (`.github/workflows/tend-*.yaml`). Tend's generated workflows do not set `timeout-minutes`, so GitHub's 360-minute default applies unless the adopter has overridden it via `workflows..jobs..timeout-minutes` in `.config/tend.yaml`. +To determine the timeout cap for a workflow, read `timeout-minutes` from that workflow's own file under `.github/workflows/` — the census admits workflows named outside the `tend-` prefix, so don't glob for one. Tend's generated workflows do not set `timeout-minutes`, so GitHub's 360-minute default applies unless the adopter has overridden it via `workflows..jobs..timeout-minutes` in `.config/tend.yaml`. ```bash # Flag long-running and near-timeout jobs @@ -165,7 +170,7 @@ Run the token report script to get per-run token counts: "${CLAUDE_PLUGIN_ROOT}/scripts/token-report.sh" 24 > /tmp/token-report.json ``` -Pass additional workflow prefixes to include non-`tend-*` workflows that use the tend action (e.g., `review-reviewers`). Check the repo's `running-tend` skill for the list. +Pass the same extra prefixes Step 1 censuses, so the two steps agree on what the fleet is — the repo's `running-tend` skill is the source for both (e.g. `review-` for a `review-reviewers` workflow that uses the tend action but isn't named `tend-*`). Include the totals and per-workflow breakdown in the summary (Step 7). Flag any runs with unusually high token usage for closer inspection in Step 3.