Skip to content

ci(workflows): bound every job with timeout-minutes - #1238

Merged
Birfy merged 7 commits into
mainfrom
agent/1235-workflow-job-timeouts
Nov 24, 2026
Merged

Birfy merged 7 commits into
mainfrom
agent/1235-workflow-job-timeouts

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1235

7 of the 12 jobs in .github/workflows/*.yml declared no timeout-minutes, so they inherited GitHub's 360-minute default: a hung Pages deploy or OIDC exchange held a runner for six hours and read as a slow check rather than a stuck one (on publish/publish-npm, while holding id-token: write).

Row per job, all twelve, before read on main at b4647375 and re-confirmed unchanged at eb9acd5e (the branch is merged up to it):

file:job before after reason where non-obvious
docs.yml:build none 15
docs.yml:deploy none 15 Pages deploy can wait on the github-pages environment
publish.yml:build none 15
publish.yml:publish none 15 OIDC exchange to PyPI, holds id-token: write
publish-npm.yml:publish none 15 OIDC exchange to npm, holds id-token: write
tests.yml:test none 45 3.9 leg peaks at 30m12s green, so 30 would cancel real runs
tests.yml:otel-wire none 15
controller.yml:plan 10 10 already set; now pinned
controller.yml:apply 10 10 already set; now pinned
labels.yml:sync 5 5 already set; now pinned
review-gate.yml:report 5 5 already set; now pinned
risk-tier.yml:report 5 5 already set; now pinned

tests.yml:test was assigned 30 during review and raised to 45: a 30-minute bound cancels legitimate green runs, not hung ones. The three slowest green test (3.9) legs:

run wall time result
45002962476 30m12s success
45159554121 29m54s success
45092006009 29m54s success

Rule applied: bound ≥ ~1.4× the observed maximum, so ~42 min → 45.

tests/test_workflow_job_timeouts.py fails on a job with no integer timeout-minutes, fails on any drift from the pinned table, and fails when a new job appears with no pinned row. The table covers all twelve jobs, including the five this PR does not change, so each failure names the file, the job, the pinned value and the value found, and marks rows outside this diff as (pre-existing value, not part of #1235's diff) — whoever edits another job sees why the table went red instead of a bare mismatch.

The branch's first commit pinned 10/5/60/10 with a tests/test_workflow_timeouts.py of the same shape; those integers were replaced by the measured ones at 40a4113f, which also removed that earlier test file, so the tip carries one test file, not two.

Evidence at base eb9acd5e:

  • red, pristine main with only the test file added: 8 failed, 7 passed, and each of the seven names its own row, e.g. .github/workflows/tests.yml job "test": expected 45 minutes, found None (same 8 failed, 7 passed on b4647375 before the branch was merged up)
  • green with the integers, actual runs at this tip: python -m pytest tests/test_workflow_job_timeouts.py -q -o addopts="" → 15 passed; python -m pytest tests/test_changelog_fragments.py -q -o addopts="" → 45 passed; the two files together → 60 passed; python -m tools.changelog_fragments --root . check → 32 changelog fragment(s) OK
  • what that 15 is, from python -m pytest tests/test_workflow_job_timeouts.py --collect-only -q → 15 tests collected: 12 test_timeout_value_is_pinned[...] row cases plus 3 helper tests (test_workflows_exist, test_every_job_declares_a_timeout, test_no_unpinned_jobs). That is a collection listing, not a sum of pass lines — the 8 failed, 7 passed above closes the same way: the presence test plus the 7 rows this PR changes fail, the 5 already-correct rows plus the 2 other helpers pass.
  • drift check, injected and then reverted:
controller.yml plan -> 12:
workflow timeout drift: .github/workflows/controller.yml job `plan` declares 12 minutes, expected 10 minutes (pre-existing value, not part of #1235's diff).

tests.yml test -> 30:
workflow timeout drift: .github/workflows/tests.yml job `test` declares 30 minutes, expected 45 minutes.

No UI surface.

Every count above is a pytest summary line from the command printed beside it at this tip, not a sum.

Tip SHA: f343c78
Ran: python -m pytest tests/test_workflow_job_timeouts.py tests/test_changelog_fragments.py -q -o addopts=""; python -m tools.changelog_fragments --root . check; full python -m pytest -q -o addopts="" at this tip
Not run: mkdocs build --strict (no docs change); the wheel smoke gate (CI runs it)

Correction (appended; branch updated to main)

Live tip 90e71d8f653635a779850abd6813aaae6da1a8bf, base 22ea7528915a761c579dc4c7f47d8444c159cd8a. The update was a merge commit that moved only the base onto live main; the diff is unchanged (6 files, +150/−0, as recorded above). This supersedes f343c78fe5c328d828518f47123517523fd19969 for this head.

@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Ready-to-review evidence for this head, posted before the flip.

Head read in this turn from GET /repos/ThinkFlowLab/agentdescent/pulls/1238 (Date: Tue, 24 Nov 2026 04:41:31 GMT):

  • head f343c78fe5c328d828518f47123517523fd19969
  • base eb9acd5e8e417241cec2a60517c7f89272b0d5be (main)

Diff against that base is exactly six paths, and nothing else:

modified  +2 -0  .github/workflows/docs.yml
modified  +1 -0  .github/workflows/publish-npm.yml
modified  +2 -0  .github/workflows/publish.yml
modified  +4 -0  .github/workflows/tests.yml
added     +9 -0  changelog.d/1235-workflow-job-timeouts.md
added   +132 -0  tests/test_workflow_job_timeouts.py

All nine inserted workflow lines are timeout-minutes. The pinning test's table covers all twelve jobs; five of those rows already declared a value on main and are pinned unchanged.

The branch carries main by a forward merge, never a rebase or a force-push: 0292d6c4 merged eb9acd5e into c1fb11d3 (parents c1fb11d3 + eb9acd5e). The branch's first commit pinned a weaker 10/5/60/10 draft; those integers were replaced by the measured ones in 40a4113f, which also removed that draft's tests/test_workflow_timeouts.py, so the tip has one test file, not two.

Measured at this head:

  • red, pristine main eb9acd5e with only tests/test_workflow_job_timeouts.py added: 8 failed, 7 passed
  • python -m pytest tests/test_workflow_job_timeouts.py -q -o addopts="" -> 15 passed
  • python -m pytest tests/test_changelog_fragments.py -q -o addopts="" -> 45 passed
  • the two together -> 60 passed
  • python -m tools.changelog_fragments --root . check -> 32 changelog fragment(s) OK

No UI surface: the change is workflow YAML plus a test, and the PR body says so.

@HugoXK
HugoXK marked this pull request as ready for review November 24, 2026 04:42
@github-actions github-actions Bot added risk:T3 Risk tier T3 (core loop, release, process; needs Danyang's click), set by the controller agent-pr Pull request opened by an agent labels Nov 24, 2026
@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Birfy: review request for #1238 at tip f343c78fe5c328d828518f47123517523fd19969 (base eb9acd5e).

@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Birfy: review request for #1238 at tip 90e71d8f653635a779850abd6813aaae6da1a8bf (base 22ea7528).

Branch updated to the live main 22ea7528915a761c579dc4c7f47d8444c159cd8a by a merge commit, so the diff is unchanged and only the base moved. Prior tip f343c78f... is superseded: a verdict naming it is not a verdict for this tip.

@Birfy

Birfy commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Review (Birfy)

Tip SHA: f343c78
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1238 → T3 (paths .github/workflows/docs.yml, publish-npm.yml, publish.yml, tests.yml; 150 lines / 6 files)
  • pytest -q -o addopts='' tests/test_workflow_job_timeouts.py at this tip → 15 passed
  • python -m tools.changelog_fragments check → 32 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
  • Required CI at this tip (build, test 3.9–3.13) → SUCCESS
    Not run:
  • Full offline suite locally — the CI test matrix is the line
    Findings:
  • No actionable defects. Every previously unbounded job now declares a finite timeout-minutes (tests 45, because the 3.9 leg measured 30m12s; the rest 15). The new test pins both the invariant and the values, including the pre-existing timeouts on controller/labels/review-gate/risk-tier, which still match current main.
    Verdict: PASS

@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Body edit, no push: appending a correction — the branch stands on base 22ea7528915a761c579dc4c7f47d8444c159cd8a with live tip 90e71d8f653635a779850abd6813aaae6da1a8bf (a merge commit that moved only the base; diff unchanged), superseding f343c78f. The existing Tip SHA: line and every section stay as written.

@Birfy

Birfy commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Review (Birfy)

Tip SHA: 90e71d8
Ran:

  • .github/scripts/risk_gate.py --repo ThinkFlowLab/agentdescent --pr 1238 → T3 (paths .github/workflows/docs.yml, publish-npm.yml, publish.yml, tests.yml; 150 lines / 6 files)
  • pytest -q -o addopts='' tests/test_workflow_job_timeouts.py at this tip → 15 passed
  • python -m tools.changelog_fragments check → 33 changelog fragment(s) OK
  • python -m tools.gen_api_docs --check → docs/api.md is up to date
  • Required CI at this tip (build, test 3.9–3.13) → still running; previous tip was SUCCESS
    Not run:
  • Full offline suite locally — the CI test matrix is the line
    Findings:
  • No actionable defects. This tip only merges main (22ea752, fix(mcp): report an unreadable run dir instead of crashing #1242) onto the previously reviewed change; the unique diff (timeout-minutes on the four workflow files, the pin test, the changelog fragment) is unchanged. Pre-existing pins on controller/labels/review-gate/risk-tier still match current main.
    Verdict: PASS

@Birfy
Birfy enabled auto-merge (squash) November 24, 2026 10:29
@HugoXK

HugoXK commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

@Birfy: review request for #1238 at tip b0a820fa443c0eaefd2ebf808ee3e99975d9969a (base 28ded70d).

Main moved to 28ded70d8cf7063f0abf2b07e20921316d28430e (#1257, #1258, #1256, #1253 merged at 10:27:34Z–10:28:24Z), so the branch is updated to it by a merge commit: diff unchanged, only the base moved. Prior tip 90e71d8f... is superseded — a verdict naming it is not a verdict for this tip.

@Birfy
Birfy merged commit e6c0149 into main Nov 24, 2026
10 checks passed
@Birfy
Birfy deleted the agent/1235-workflow-job-timeouts branch November 24, 2026 10:55
Birfy pushed a commit that referenced this pull request Nov 24, 2026
Fixes #1252.

## What changed
`plan`'s `next:` and `--json.next` now name the smallest of the
structural bound, the spec's declared cap (#1219) and the call cap the
run will actually enforce, so a 2-call `AGENTDESCENT_MAX_CALLS` ceiling
no longer produces `--max-calls 11` with `warnings: []`; when the
ceiling lowers the advice, `warnings` says so (`AGENTDESCENT_MAX_CALLS=2
caps this run at 2 calls; the plan estimates 11`), and a malformed
ceiling is the config answer `evolve` would raise instead of a
traceback. The MCP face: a spent Ticket makes `Tools.plan` refuse in
`start`'s exact sentence and bytes, instead of answering `ok: true` with
`max_calls: 0`. Reporting only — `estimate.agent_calls_upper_bound`,
`call_limit`'s numbers, enforcement and every stop reason are untouched,
and an uncapped plan's text and JSON do not change.

Not a goal: `algorithms run`'s own `next:` (the issue names the `plan`
surface) and any change to what is enforced.

Draft: `#1238` and `#1250` are the two ready PRs in the owner-click
queue.

## Verification at the tip
Tip SHA: 7917e76
Ran:
- red first at `22ea7528915a761c579dc4c7f47d8444c159cd8a`: new
`tests/test_plan_advice_ceiling.py` → 5 failed, 3 controls passed
(`assert 'agentdescent…--max-calls 11' == 'agentdescent…--max-calls 2'`)
- `tests/test_plan_advice_ceiling.py` → pass (8 passed; 14 passed with
the #1219 rows)
- plan/CLI family (`test_plan_next_respects_spec_cap`,
`test_plan_text_output`, `test_plan_probe`, `test_plan_headroom_shape`,
`test_first_run_caps`, `test_cli_algorithms_run`, `test_demo`) → pass
(136 passed)
- Ticket/cap family (`test_mcp_ticket_cap`, `test_mcp_call_limit`,
`test_mcp_ticket_remainder_label`, `test_operator_run_cap`, `test_mcp`)
with `test_changelog_fragments` and `test_api_reference` → pass (164
passed)
- `python -m tools.changelog_fragments check` → 33 changelog fragment(s)
OK
  - `python -m tools.gen_api_docs --check` → docs/api.md is up to date
- `pytest -q` (full suite at this tip) → `21 failed, 8085 passed, 51
skipped, 526 warnings in 2005.70s (0:33:25)`; the 21 are the four known
environment files only (`test_sandbox_container.py` 12,
`test_era_srbench.py` 6, `test_genesis_example.py` 2,
`test_wheel_smoke.py` 1), the same set the base run produces, and none
of them touch `cli.py`, `mcp.py` or the new test file
Not run:
  - `mkdocs build --strict` → not applicable (no docs change)
- wheel smoke / real-model check → not needed for a reporting-only
change

## Correction (appended; tip unchanged)
The plan/CLI family bullet above names seven files and reports `136
passed`; those seven files alone are `128`. The `136` was the same run
with the new file's `8` rows added, so the bullet counted
`tests/test_plan_advice_ceiling.py` a second time. Seven-file figure:
`128 passed`. Every other number in the evidence block measures as
written.

Correction, closing the stale sha (append-only; nothing above changes):
the `Tip SHA:` line above is not the reviewed head — review request
`7129820256` named the live head
`29b2a1ec3e9fb9f07da0f68f02606ee624898ba9`. The plan/CLI family bullet's
`136` is those seven files' `128` plus the new file's `8`;
`--collect-only` gives 128 at both `7917e762` and `29b2a1ec`. Every
other number and section stands as written.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-pr Pull request opened by an agent risk:T3 Risk tier T3 (core loop, release, process; needs Danyang's click), set by the controller

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: every workflow job declares timeout-minutes, and a test pins it

2 participants