From b8200769ea826b94199953ffbea2f64485227623 Mon Sep 17 00:00:00 2001 From: tend-agent <270458913+tend-agent@users.noreply.github.com> Date: Fri, 7 Aug 2026 08:43:47 +0000 Subject: [PATCH 1/3] fix(review-runs): census the prefixes Step 2 prices, not just tend-* Step 1 hard-coded `startswith("tend-")` while Step 2 documents extra prefixes for workflows that use the tend action under another name, so the two steps disagreed about what the fleet is. Runs under an extra prefix were never classified for duration, never near-timeout-checked, and never reached Step 3's log analysis. Drive both from one repo-level list in `running-tend`. Refs #888 --- plugins/tend-ci-runner/skills/review-runs/SKILL.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/tend-ci-runner/skills/review-runs/SKILL.md b/plugins/tend-ci-runner/skills/review-runs/SKILL.md index 2db2fa88..6aef74ca 100644 --- a/plugins/tend-ci-runner/skills/review-runs/SKILL.md +++ b/plugins/tend-ci-runner/skills/review-runs/SKILL.md @@ -131,7 +131,13 @@ 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 +# Census every workflow that runs the tend action, not only the generated +# `tend-*` ones — a workflow named outside that prefix is otherwise never +# classified, never near-timeout-checked, and never reaches Step 3. The repo's +# `running-tend` skill carries the extra prefixes; Step 2 takes 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 @@ -165,7 +171,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. From 3d4fcdafe124c43c1fc511d4545e1d2826708a73 Mon Sep 17 00:00:00 2001 From: tend-agent <270458913+tend-agent@users.noreply.github.com> Date: Fri, 7 Aug 2026 08:51:45 +0000 Subject: [PATCH 2/3] fix(review-runs): resolve the timeout cap per workflow file, not a tend-* glob MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The near-timeout check globbed `.github/workflows/tend-*.yaml`, which does not match a workflow the widened census now admits — so such a run was duration-classified with no file to read a cap from. --- plugins/tend-ci-runner/skills/review-runs/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tend-ci-runner/skills/review-runs/SKILL.md b/plugins/tend-ci-runner/skills/review-runs/SKILL.md index 6aef74ca..99ff4fed 100644 --- a/plugins/tend-ci-runner/skills/review-runs/SKILL.md +++ b/plugins/tend-ci-runner/skills/review-runs/SKILL.md @@ -150,7 +150,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 From f8234946e0e6db7083fe53e52213c77129cde69c Mon Sep 17 00:00:00 2001 From: tend-agent <270458913+tend-agent@users.noreply.github.com> Date: Fri, 7 Aug 2026 08:54:05 +0000 Subject: [PATCH 3/3] fix(review-runs): make the PREFIXES comment an instruction, not a rationale The comment above PREFIXES explained why the census was widened rather than telling the reader to add their repo's extra prefixes. Lead with the action, per CLAUDE.md's skill-authoring rule. --- plugins/tend-ci-runner/skills/review-runs/SKILL.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/tend-ci-runner/skills/review-runs/SKILL.md b/plugins/tend-ci-runner/skills/review-runs/SKILL.md index 99ff4fed..94ac06c1 100644 --- a/plugins/tend-ci-runner/skills/review-runs/SKILL.md +++ b/plugins/tend-ci-runner/skills/review-runs/SKILL.md @@ -131,10 +131,9 @@ 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) -# Census every workflow that runs the tend action, not only the generated -# `tend-*` ones — a workflow named outside that prefix is otherwise never -# classified, never near-timeout-checked, and never reaches Step 3. The repo's -# `running-tend` skill carries the extra prefixes; Step 2 takes the same list. +# 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