From 0885cdec0340586caf9b7da83de3d032ec173222 Mon Sep 17 00:00:00 2001 From: tend-agent Date: Mon, 15 Jun 2026 10:05:56 +0000 Subject: [PATCH 1/2] fix(running-in-ci): trim CI-poll loops to fit Bash tool's 10-min cap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The foreground CI-poll recipe and the rerun-jobs poll both ran `for i in $(seq 1 15); do sleep 60; ...; done` — a minimum of 15 minutes if CI didn't finish early. The Claude Code Bash tool's max configurable timeout is 600000 ms (10 min), past which the harness auto-backgrounds the call and blocks foreground `sleep` waits. Once that happens the gated follow-up (dismiss approval on failure, post failure analysis) can't fire in-session — background-completion notifications are not reliably delivered to a CI session, per the same skill's own policy. Trim both loops to `seq 1 9` (≥9 min minimum) so the recipe fits inside the harness cap, and add a note that callers must invoke Bash with `timeout: 600000` (the default 2-min timeout would kill the loop early). Closes #694 Co-Authored-By: Claude --- plugins/tend-ci-runner/skills/running-in-ci/SKILL.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md b/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md index 7734d7b..bfcdd90 100644 --- a/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md +++ b/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md @@ -220,7 +220,7 @@ After pushing, decide based on whether a concrete follow-up is gated on the CI r # tend-mention's `tend-mention-handle-{PR#}` group), the sibling's handle job # queues behind the current one — its CheckRun shows PENDING in the rollup # but it can't start until the current run exits. Polling for it deadlocks -# until the 15-min cap breaks it. For workflows +# until the loop cap breaks it. For workflows # with `cancel-in-progress: true`, the older sibling is cancelled and # wouldn't gate polling anyway, so this filter is a no-op there. # @@ -238,7 +238,7 @@ pending() { | select(. == "IN_PROGRESS" or . == "QUEUED" or . == "PENDING" or . == "WAITING" or . == "REQUESTED" or . == "EXPECTED") ] | length' } -for i in $(seq 1 15); do +for i in $(seq 1 9); do sleep 60 [ "$(pending)" -gt 0 ] && continue sleep 30 @@ -246,11 +246,13 @@ for i in $(seq 1 15); do gh pr checks exit 0 done -echo "CI still running after 15 minutes" +echo "CI still running after 9 minutes" exit 1 ``` -1. Poll every 60 seconds (up to ~15 minutes) until all non-own check-runs on the commit are terminal. **Filter out the current run's URL (`/runs/$GITHUB_RUN_ID/`)** — the current workflow's own check is always pending while polling and must be excluded to avoid a deadlock. **Also filter same-workflow check runs (`$GITHUB_WORKFLOW`)** — sibling runs of the same workflow on the same PR are subject to concurrency rules (queueing or cancel-in-progress) and don't represent independent CI signals. The 30s grace re-check catches late-registering omnibus checks. +Invoke this Bash call with `timeout: 600000` (10 min). The default 2-min Bash timeout would kill the loop early; the 9-iteration cap is sized to fit inside the harness's 10-min Bash maximum, so a longer loop would auto-background and the gated follow-up wouldn't fire. + +1. Poll every 60 seconds (up to ~9 minutes) until all non-own check-runs on the commit are terminal. **Filter out the current run's URL (`/runs/$GITHUB_RUN_ID/`)** — the current workflow's own check is always pending while polling and must be excluded to avoid a deadlock. **Also filter same-workflow check runs (`$GITHUB_WORKFLOW`)** — sibling runs of the same workflow on the same PR are subject to concurrency rules (queueing or cancel-in-progress) and don't represent independent CI signals. The 30s grace re-check catches late-registering omnibus checks. 2. If a required check fails, diagnose with `gh run view --log-failed`, fix, commit, push, repeat. 3. Once checks are terminal, perform the gated follow-up. @@ -288,7 +290,7 @@ pending_jobs() { done echo "$n" } -for i in $(seq 1 15); do +for i in $(seq 1 9); do [ "$(pending_jobs)" -eq 0 ] && break sleep 60 done From 8902ff7935361b85ac6d85f679864eb29fd00726 Mon Sep 17 00:00:00 2001 From: tend-agent Date: Mon, 15 Jun 2026 10:14:09 +0000 Subject: [PATCH 2/2] fix(running-in-ci): add timeout note to gh run rerun loop too Self-review caught that the timeout: 600000 caller note was only added next to the CI Monitoring loop, not the structurally-identical gh run rerun --failed rollup loop below. A reader following just the rerun recipe would still hit the default 2-min Bash timeout. Co-Authored-By: Claude Opus 4.7 --- plugins/tend-ci-runner/skills/running-in-ci/SKILL.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md b/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md index bfcdd90..d6cdd22 100644 --- a/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md +++ b/plugins/tend-ci-runner/skills/running-in-ci/SKILL.md @@ -296,6 +296,8 @@ for i in $(seq 1 9); do done ``` +As with the CI Monitoring loop above, invoke this Bash call with `timeout: 600000` (10 min) — the default 2-min Bash timeout would kill the loop early, and the 9-iteration cap is sized to fit inside the harness's 10-min Bash maximum. + ## Replying to Comments Reply in context rather than creating new top-level comments: