Skip to content

fix(running-in-ci): make the rerun poll cap terminal, and print conclusions - #951

Merged
max-sixty merged 2 commits into
mainfrom
fix/rerun-poll-cap-terminal
Aug 12, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/rerun-poll-cap-terminal

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Surfaced by the nightly rolling survey of plugins/tend-ci-runner/skills/running-in-ci/SKILL.md.

The CI Monitoring loop two sections up is terminal in both directions — exit 0 once the checks are terminal, echo + exit 1 when the 9-iteration budget runs out. The gh run rerun --failed loop below it is not: it breaks out on success and falls off the end on exhaustion, so those two outcomes produce identical output. An agent reading that transcript has nothing to distinguish "every reran job finished" from "the budget ran out with jobs still pending", and the natural reading of the silence is the first one.

The same loop also never printed a conclusion. pending_jobs only asks whether each job's .status reached completed, which is true of a job that failed again — the exact outcome a rerun exists to detect. So even the success path handed the next step no signal.

This makes the loop mirror the one above: print each job's conclusion and exit 0 when the last one lands, exit 1 with a message on the cap. The trailing paragraph now says why, and carries over the "the cap is the whole poll budget, don't re-enter" rule that item 4 of the CI Monitoring list already states.

No test — the change is skill prose plus the shell recipe embedded in it, and the repo has no harness that executes recipes out of skill markdown.

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The recipe now distinguishes "jobs finished" from "budget exhausted", but one path still lands on the ambiguous side: when JOB_IDS comes back empty, pending_jobs echoes 0 on the first iteration, the new conclusion loop iterates over nothing, and the recipe exit 0s with no output — which reads exactly like a clean rerun. That's not hypothetical: the comment above sleep 10 names the case ("the next query can see only the prior failure rows and exit immediately"), and a 10s sleep mitigates the attempt-registration lag rather than guaranteeing it's gone. Inline suggestion below adds the guard.

Second suggestion is about skill length rather than correctness — the recipe already shows exit 0 and exit 1, so the sentence explaining why it exits in both directions is motivation the reader doesn't need to apply the rule (per CLAUDE.md's "cut motivation" for skill authoring). The operative half — cap is the whole budget, report unverified — is worth keeping.

Rest of the change reads correctly to me: --jq '"\(.conclusion)\t\(.name)"' is valid jq interpolation, and exiting 0 on a re-failed job matches the CI Monitoring loop above, which also exits 0 on terminal-but-red and leaves the verdict to the follow-up step.

@max-sixty
max-sixty merged commit 6448e84 into main Aug 12, 2026
13 checks passed
@max-sixty
max-sixty deleted the fix/rerun-poll-cap-terminal branch August 12, 2026 12:37
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 13, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.14 → 0.1.15

**Notable changes**

- **Rate-limit handling**: a maintainer can approve past the spike limit
(max-sixty/tend#874), and `tend-mention` now skips comments on
`tend-rate-limit`-labelled issues as well as `tend-outage` ones — the
same self-trigger loop guard, widened to every issue tend files about
its own health.
- **Review flow**: a push is queued behind an examined-HEAD gate instead
of cancelling the in-flight review (max-sixty/tend#903), the review is
submitted before a fix is pushed (max-sixty/tend#834), a force-push
triggers a re-review rather than trusting the re-anchored SHA
(max-sixty/tend#884), and the `/code-review` second pass is
unconditional (max-sixty/tend#937).
- **CI monitoring**: both the check poll and the `gh run rerun --failed`
poll now end terminally when the cap is hit instead of reading as done
(max-sixty/tend#876, max-sixty/tend#951), and a failed GitHub-status
probe no longer reads as "no incident" (max-sixty/tend#913).
- **Nightly**: conflicted bot PRs are test-merged locally instead of
filtered on the lazy `mergeable` field (max-sixty/tend#898), and mention
runs skip the bot's own review and a third party's content-free approval
(max-sixty/tend#916, max-sixty/tend#955).
- **`tend check`**: an unreadable ruleset bypass list is reported as
unknown rather than ungated (max-sixty/tend#825), environment names are
read one per line and addressed encoded (max-sixty/tend#879), and
`credential-environments` no longer points at the setting it rejects
(max-sixty/tend#900) — this repo currently `SKIP`s that check, so its
wording should improve here.

Full comparison:
max-sixty/tend@0.1.14...0.1.15

Co-authored-by: worktrunk-bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants