Skip to content

fix(workflows): drop hardcoded 60-min job timeout - #223

Merged
max-sixty merged 1 commit into
mainfrom
raise-job-timeouts
Apr 10, 2026
Merged

max-sixty merged 1 commit into
mainfrom
raise-job-timeouts

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A tend-mention handle run in max-sixty/worktrunk hit 58m51s against the 60-min cap doing real multi-step work — 4 commits across a shell-integration fix, docs, codecov coverage gaps, and a snapshot refresh, with ~24 min spent waiting on slow codecov/patch. A clean near-miss on legitimate work, not a hang.

The 60-minute constant had no principled basis. Rather than tuning the magic number to 120 (or 180, or 240), this drops the line entirely and falls back to GitHub's 360-min default. That removes a knob instead of adding one, which is the right direction given the repo's "no new options" rule.

Trade-off: worst-case runaway exposure goes from 1h to 6h per stuck job. The motivating incident was a near-miss on real work, not a runaway, so this seems acceptable — and a stuck job is bounded and observable either way.

Per-workflow override is a separate question to consider: there's currently no pass-through mechanism in WorkflowConfig for arbitrary job-level YAML keys. If we want one, that's its own design discussion.

Co-Authored-By: Claude [email protected]

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

A `tend-mention handle` run hit 58m51s against the 60-min cap doing real
multi-step work (4 commits, 24 min waiting on slow `codecov/patch`). The
constant had no principled basis — falling back to GitHub's 360-min default
is the simpler fix than tuning a magic number, and removes a knob rather
than adding one.

Co-Authored-By: Claude <[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.

One drive-by observation, not blocking: .github/workflows/review-reviewers.yaml still sets timeout-minutes: 60. It's hand-maintained (not generated) so it's legitimately out of this PR's scope, but it's a bot workflow running Claude against a matrix of adopter repos — the same rationale that motivated this change applies. Happy to push a follow-up commit to drop it there too if you'd like consistency across all bot workflows in the repo.

@max-sixty
max-sixty merged commit bd23473 into main Apr 10, 2026
5 checks passed
@max-sixty
max-sixty deleted the raise-job-timeouts branch April 10, 2026 19:45
max-sixty added a commit that referenced this pull request Apr 10, 2026
The `review-runs` sweep currently can't see two related problems: its
lookback window was shorter than its cron interval, and it never
inspects job duration. Both come up in the same place, so bundled.

## Window fix

The window was `12 hours ago` but the cron runs daily at 07:47 UTC. Runs
completing between 12–24 hours before the sweep were silently skipped
forever. Widened to 24 hours (and the same change in the
`token-report.sh` call so its window matches).

## Long-running job detection

Added a scan after the Step 1 run listing: for each run, pull its jobs
via `/runs/{id}/jobs` and flag any that ran over 30 minutes. Tend
workflows typically finish in single-digit minutes, so anything past 30
is anomalous. At GitHub Actions' 360-min default cap (after #223 dropped
the `timeout-minutes` constant), a ~360-min `failure` is the runner-kill
signature.

Flagged jobs feed into the existing Step 3 session-log download and Step
6 summary. Treated as **structural** failures per `review-gates.md` —
one occurrence is enough to act.

Motivated by worktrunk run
[24254014913](https://github.com/max-sixty/worktrunk/actions/runs/24254014913):
a tend-mention `handle` job that ran 58:51 on a legitimate multi-commit
review (shell-integration fix, docs, codecov gaps, capitalization
snapshot), most of the tail spent in background `Task` polls waiting on
slow `codecov/patch`. `conclusion: success`, exit code 0 —
indistinguishable from a 3-minute happy path in today's sweep.

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

Co-authored-by: Claude <[email protected]>
max-sixty added a commit that referenced this pull request Apr 10, 2026
Same rationale as #223 — fall back to GitHub's 360-min default rather
than maintaining an arbitrary constant. This is the hand-maintained
`review-reviewers.yaml` (not generated by tend), which tend-agent
flagged in the #223 review.

Co-Authored-By: Claude <[email protected]>

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

Co-authored-by: Claude <[email protected]>
@tend-agent tend-agent mentioned this pull request Apr 11, 2026
2 of 3 tasks
tend-agent pushed a commit that referenced this pull request Apr 13, 2026
When `generator/pyproject.toml` exists (i.e. on the tend repo itself),
Step 5 of the nightly skill now regenerates workflows via the in-tree
generator instead of `uvx tend@latest`. Adopter repos without `generator/`
fall through to the existing `uvx tend@latest` path unchanged.

Motivation: PR #264 (from run 24330194038) ran `uvx tend@latest init` with
PyPI's `tend` at 0.0.11 (released 2026-04-10). `main` has 10 generator
commits landed since — #223 (drop hardcoded job timeouts), #225 (dedup
review events), #227 (workflow_extra), #228 (paginate), #231 (inline-reply
guidance), #233 (drop bot-author filter on issue_comment), #235 (prompt →
skill), #254 (notifications freshness gate + bot-closed-PR drop), etc.
Regenerating against the stale wheel reverted each of these. Maintainer
flagged the PR as regressions; diagnosis confirmed the PyPI lag.

Co-Authored-By: Claude Opus 4.6 <[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