Repository navigation
skills(running-tend): poll rerun jobs, not the parent run - #2449
Conversation
After `gh run rerun --failed`, polling the parent run's `.status` blocks the bot for the duration of the slowest sibling job, even though the rerun itself finishes in minutes. Two recent occurrences each blocked ~150 min waiting on `benchmarks` while the actually-rerun job was green within minutes.
worktrunk-bot
left a comment
There was a problem hiding this comment.
One blocking concern in the new recipe — see inline suggestion.
Two smaller observations on the same block:
- Race window between rerun and query.
gh run rerun --failedreturns immediately, but the new attempt records may not be visible fromruns/<id>/jobs?filter=latestfor a second or two. If the query lands in that window, every job still shows the priorcompleted/failurestatus,JOB_IDSis empty, and the bot moves on without waiting at all. A 5–10s sleep between the rerun and the query closes the race. - Sequential per-job polling. With one rollup-style loop (
lengthof the not-yet-completed set) the bot polls all reran jobs in parallel and exits when the last one terminates. The current per-job nested loop is correct but pays a 15-min cap per job; for 2–3 reran jobs that compounds. Optional structural simplification, not a blocker.
… poll Address self-review feedback on the rerun-polling section: - Replace `select(.status \!= "completed")` with `select((.status == "completed") | not)`. The Bash tool rewrites `\!` to `\\!` before bash parses the command, so the original filter would fail every time the recipe is copy-pasted into a Bash call — defeating the whole point of the section. - Add a `sleep 10` between `gh run rerun --failed` and the `jobs?filter=latest` query. The new attempt records take a few seconds to surface; without the sleep the query can see only the prior `completed`/`failure` rows and exit without waiting. - Switch the polling loop from sequential per-job to a rollup that polls all reran jobs together each minute, matching the pattern used by the bundled `running-in-ci` `pending()` recipe.
|
these skills should be less verbose. they should not reference specific past runs, because that's not helpful for the consuming repos. so:
|
|
Done.
|
|
sorry: @tend-agent & @worktrunk-bot I think this guidance should go into tend's guidance |
|
Got it — moved the The skill-authoring guidance itself belongs in |
|
can we also remove the |
Per PR #2449 maintainer feedback, this guidance is general-purpose and belongs in tend's bundled skills (where tend-agent can pick it up across consumer repos), not in worktrunk's overlay. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Done — pushed ea7513bb to #2451 dropping the |
## Summary Per #2449 maintainer feedback, this PR was originally going to add skill-authoring guidance to `CLAUDE.md` and apply an audit to existing skills. The follow-up comment clarified that the *guidance itself* belongs in tend's repo (where `tend-ci-runner` skills are bundled and shared across consumers), not in worktrunk's `CLAUDE.md` — so I've dropped the `CLAUDE.md` commit. What's left is the audit fix the guidance prompted: the `running-tend` skill no longer cites the dated `Baseline as of 2026-04-13 ... (see PR #2209)` reference, just the structural rule (`~29 baseline, jump above ~32 warrants investigation`). The skill-authoring guidance itself needs to land in max-sixty/tend (likely under "Skill design: bundled for everyone, overlay for one" in that repo's CLAUDE.md). The bot doesn't have push access there, so that's a separate manual change. --------- Co-authored-by: worktrunk-bot <[email protected]> Co-authored-by: Claude Opus 4.7 <[email protected]>
|
Picked up the rerun-polling recipe in tend #350 — added it as a subsection under "CI Monitoring" in the bundled |
## Summary Add an "Authoring skills" subsection to `CLAUDE.md` codifying the four rules max-sixty raised in [worktrunk#2449](max-sixty/worktrunk#2449 (comment)): be brief, no specific past-run references, date-stamp only when time-dependent, prefer recipe over narrative. ## Context The same guidance was originally drafted into worktrunk's `CLAUDE.md` ([commit 585ece7e](max-sixty/worktrunk@585ece7e), since force-pushed away). Per max-sixty's note in [worktrunk#2449](max-sixty/worktrunk#2449 (comment)) (`I think this guidance should go into _tend_'s guidance`), the rule belongs here — `tend-ci-runner` skills are bundled and shared across consumers, so the authoring style applies to every consumer's overlays as well as tend's own bundled skills. Placed under the existing "Skill design: bundled for everyone, overlay for one" heading. Scoped to `plugins/tend-ci-runner/skills/` (bundled) and `.claude/skills/` (overlays). Co-authored-by: tend-agent <[email protected]>
## Summary After `gh run rerun <run-id> --failed`, the bot has been polling the parent run's `.status` for `completed`. That status stays `in_progress` until every sibling job finishes — including unrelated long-running ones — so the rerun loop blocks waiting on jobs the bot does not care about. Add a recipe to bundled `running-in-ci` showing how to poll the rerun job IDs via `repos/.../actions/jobs/<id>`, and note that the existing `pending()` (statusCheckRollup) recipe doesn't help because sibling check-runs on the head SHA still appear pending. ## Context Per max-sixty's request in [worktrunk#2449](max-sixty/worktrunk#2449 (comment)) and [worktrunk#2451](max-sixty/worktrunk#2451 (comment)): the same recipe was originally landed as a worktrunk overlay, but the rule is universal across consumers, so it belongs in the bundled skill. The overlay is being removed in worktrunk#2451. --------- Co-authored-by: tend-agent <[email protected]> Co-authored-by: Claude <[email protected]>
Summary
Add a section to
running-tend/SKILL.mdcovering thegh run rerun --failed+until status == completedpolling pattern. Two long sessions across consecutive review-runs windows blocked for 2-2.5 hours each because the bot polled the parent CI run's status instead of the specific rerun job(s).Evidence
This is the second occurrence of the same structural pattern across two consecutive review-runs windows. Last review's tracking entry (Run 24986870769) flagged it as below threshold pending recurrence: "If a second occurrence appears within the next two windows, file as a structural-fix PR to
running-tend."benchmarkson parent CI run 24975304781 ran 03:35→06:02 (147 min)benchmarkson parent CI run 25015241976 ran 23:50→02:21 (150 min)In both cases the bot ran:
The
--failedrerun's actual job (test (linux)) finished in ~5 min. Theuntilloop kept polling because the parent run's status isin_progressuntil every job — including the unrelated, still-runningbenchmarkssibling — completes. Net wallclock cost: ~2.5h × 2 incidents = ~5h of bot time blocked on a job it didn't care about.Classification
Fix
The new section instructs the bot to poll the specific rerun job ID(s) via
gh api repos/.../actions/jobs/<id>, not the parent run's.status. It also notes that the bundledrunning-in-cipending()recipe doesn't help here sincebenchmarksis itself a check-run on the head SHA.🤖 Generated with Claude Code