Skip to content

Start ci-fix only on failed runs, not cancelled ones - #1535

Merged
max-sixty merged 2 commits into
mainfrom
drop-cancelled-ci-fix
Oct 11, 2026
Merged

max-sixty merged 2 commits into
mainfrom
drop-cancelled-ci-fix

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

On a busy default branch, nearly every cancelled run is one that a newer commit superseded. tend-ci-fix keeps one pending trigger per watched workflow and branch, so each of those cancellations replaced whatever trigger was waiting, including a failure's. In max-sixty/leaf on 2026-10-10, main recorded 96 cancelled ci runs and 3 failed ones. Twice, a failed run's trigger waited behind a busy session and was replaced by a cancellation's trigger, 30 and 10 minutes later. The session that eventually ran started on a cancellation and exited in seconds, so neither failure was worked by the bot.

The job's if: now admits only failure, and ci-fix drops its cancellation branch. The prompt drops its Conclusion: line, which would now always read failure. The README and the example config say "fails" rather than "fails or is cancelled".

A job that hits its timeout also ends cancelled, so it no longer starts a session. TODO.md records that gap alongside the design that would close it: issues as the bus from failing runs to fixes, filed by a deterministic step, with deduplication and granularity left open.

This changes when the agent runs, not how it behaves once running, so no eval case covers it. The generator/tests/test_generate.py assertions and the regtest snapshots cover the new condition.

This was written by Claude Code on behalf of max-sixty

On a busy default branch nearly every cancelled run is one a newer commit
superseded. tend-ci-fix keeps one pending trigger per watched workflow and
branch, so each of those cancellations replaced whatever was waiting,
including a failure's trigger. On max-sixty/leaf on 2026-10-10, main
recorded 96 cancelled `ci` runs and 3 failed ones; a failed run whose
trigger waited behind a busy session was replaced 30 minutes later by a
cancellation's, and the session that finally ran started on a cancellation
and exited in seconds. The failure was never worked.

The job's `if:` now admits only `failure`, and ci-fix drops its
cancellation branch and the prompt's now-constant `Conclusion:` line. A job
that hits its timeout also ends cancelled and now starts no session; TODO.md
records that gap with the design that would close it, issues as the bus from
failing runs to fixes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The generated workflow comment carries Tend-specific rationale and a reference to Tend’s own TODO into every consumer. The inline suggestion keeps the shipped comment scoped to the default; the existing TODO entry retains the project rationale.

The rationale and the TODO reference belong to tend, not to every
consumer's workflow.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit 8b7ebd5 into main Oct 11, 2026
13 checks passed
@max-sixty
max-sixty deleted the drop-cancelled-ci-fix branch October 11, 2026 08:57
@max-sixty max-sixty mentioned this pull request Oct 12, 2026
max-sixty added a commit that referenced this pull request Oct 12, 2026
Bumps the generator to 0.3.12 and adds its changelog section. Ships
#1538, #1534, #1535, #1536, #1527, #1533, #1531 and #1537.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Oct 13, 2026
Regenerates the Tend workflows with tend 0.3.13 (from 0.3.11). The one
behavior change in the generated files is that `tend-ci-fix` now starts
only when a watched workflow on `main` **fails**; a cancelled run no
longer starts a session, and the prompt drops its `Conclusion:` line
since it is always a failure
([max-sixty/tend#1535](max-sixty/tend#1535)).
Every other workflow changes only its action pin.

Other changes riding in with the new action version:

- The bundled Claude Code CLI moves to 2.1.296 (max-sixty/tend#1536).
- The CI skills weigh whether rerunning an unrelated CI failure is worth
it before triggering the rerun (max-sixty/tend#1541).
- A new opt-in `workflows.review.await_ci` setting lets a review finish
without waiting for CI (max-sixty/tend#1538). This repo doesn't set it,
so reviews behave as before.

The PR also updates the nightly overlay
(`.claude/skills/running-tend/references/nightly-cleaner.md`), which
said `tend-ci-fix` fires on cancelled runs and reads a `Conclusion:`
line. Neither holds after this upgrade.

Full upstream diff:
max-sixty/tend@0.3.11...0.3.13

Co-authored-by: worktrunk-bot <[email protected]>
max-sixty added a commit that referenced this pull request Oct 14, 2026
`tend-ci-fix` starts only on a watched run's `failure` (#1535), and
GitHub ends a job that exceeds its time limit as `cancelled`, so a CI
job that hangs until its limit never gets a ci-fix session. A step that
exceeds its own `timeout-minutes` fails instead, so a consumer that
bounds the hang there gets it diagnosed. A probe workflow on
tend-agent/tend-integration confirmed all three conclusions: a
foreground step timeout and a `background: true` step timeout both fail,
and a job timeout is cancelled.

This isn't hypothetical. max-sixty/leaf's push suite hit the 6-hour job
limit four times between 2026-10-04 and 2026-10-14, and none of those
runs started a ci-fix session.

- `docs/tend.example.yaml` (and its install-tend mirror) tells consumers
this in the ci-fix section.
- `TODO.md`'s "Issues as the bus" entry now records the step-timeout
workaround, the per-event pending slot from #1547, and the concurrent
push and scheduled sessions #1547 allows.

> _This was written by Claude Code on behalf of max-sixty_

Co-authored-by: Claude Opus 5.5 (1M context) <[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