Skip to content

fix(ci): cap each Refine fix-docs leg at 15 minutes - #16889

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/14292-refine-leg-cap
Nov 17, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/14292-refine-leg-cap

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Refs: #14292

Summary

Review lanes wait behind a Refine fix-docs run that changes nothing, for 20 to 37 minutes (#14292). The owner chose option A (decision): cap each fix-docs leg at 15 minutes and lower the wait cap to match. This PR does that. It adds no pre-check job, and the review lanes still wait for Refine (options B and C were not chosen).

Fix

  • Each fix-docs leg's model run is capped at 15 minutes. .github/workflows/pr-refine.yml sets timeout-minutes: 30 (down from 60) on all three fix-docs calls: fix-docs (the first run), fix-docs-subscription and fix-docs-fallback.
    • Basis: that input is the read runner's run-job timeout. pr-run-activity-read.yml:1135-1140 ("Check the launcher's inputs") gives the launcher step TIMEOUT - 10 and the model leg TIMEOUT - 15 (echo "leg-minutes=$((TIMEOUT - 15))"); docs/conventions/pr-pipeline/README.md:3687 states the same rule ("The launcher's leg gets the timeout less 15 minutes").
    • So 30 gives a 15-minute leg inside a 20-minute step inside a 30-minute job. Before this change, 60 gave a 45-minute leg, so 20 to 37-minute no-change runs finished inside it.
  • The default wait cap in .github/scripts/pr-review/wait-refine.mjs is now 1800 s, down from 2400 s. Basis: judgment, from this arithmetic:
    • The cap is the fix-docs run job's timeout: a 15-minute leg plus the 15 minutes the runner reserves around it is 30 minutes, or 1800 s.
    • 900 s (the bare leg) is too short. A leg that runs to its cap ends after the run job's setup steps and the Refine jobs before it, which puts it well past 900 s from the review's start. The wait would expire first, the review would judge untidied code, and a Refine push would trigger a second review.
    • 1800 s covers a typical first-leg run, not the worst case. The run job alone may take its full 30 minutes, and other Refine jobs run before it; a run that hands off to the subscription or fallback leg takes longer still. Past the cap the review runs, as it does today (refine-timeout).
  • Statements of the old cap:
    • docs/conventions/pr-pipeline/README.md now says "waits up to 30 minutes", and a pr-pipeline changelog fragment records the change.
    • The wait-step comments in pr-review-hosted.yml and pr-review-security-hosted.yml restated the cap. They are removed, not rewritten: this repository's comment lint fails a changed comment that cites no outside source.
    • The step's 45-minute timeout still bounds the new worst case: 1800 s plus two 60 s confirming sleeps is 1920 s. callers.test.mjs pins 45 and 50.

Verification

  • Tests first. The new and updated expectations failed on the old values:
    • callers.test.mjs, "pr-refine.yml: fix-docs-subscription runs only after fix-docs handed off": 60 !== 30. It now checks all three fix-docs legs, where it used to check only the first. fix-ci in pr-unblock.yml stays at 60.
    • wait-refine.test.mjs, "readEnv takes PR_BASE_REF and PR_HEAD_REPO": capMs: 2400000 vs 1800000. This test pins the default cap.
  • After the change, on the pushed head: wait-refine.test.mjs + pr-refine/gate-jobs.test.mjs + resolve-config/callers.test.mjs, node --test --test-concurrency=4: pass 341, fail 0.
  • actionlint is clean on the three changed workflows. zizmor --offline on pr-refine.yml reports no findings.
  • Not run locally: the full .github suite (CI runs it) and a live Refine run. Nothing here measures how long a fix-docs run that does push a commit takes, so whether 15 minutes ever cuts off a real fix is unverified. The issue's triage asked the owner to confirm this against those runs.

Remaining

  • Done-when item 1 cannot be met as written. It asks for timeout-minutes: 15 on each fix-docs leg. The read runner refuses that value: pr-run-activity-read.yml "Check the launcher's inputs" fails the run job when [ "$TIMEOUT" -le 15 ] ("a skill's run job needs a timeout-minutes over 15, to hold the launcher step"). Every fix-docs run would go red before any model turn.
  • This PR reads the decision's "cap each docs-fix leg at 15 minutes" as a 15-minute model leg, which is timeout-minutes: 30.
  • The owner either accepts that reading, or decides to lower the runner's floor. Lowering the floor changes every skill lane's run job and is outside this issue. Hence Refs:, not Closes.

Other findings

  • A leg that reaches the 15-minute cap now ends red, where today's 20 to 37-minute no-change runs end green.
    • ci-workflows' run-claude-cli (action.yml at the pinned 24067add, input leg-timeout-minutes): "a leg that reaches it ends with class timeout", and "The step fails ... whenever lane-class is not empty". pr-run-activity-read.yml:2548-2559 ("Fail without a result") then fails the run job.
    • From code comments, not traced further in this PR (UNVERIFIED):
      • fix-docs-dispatch.mjs:33-38 dispatches a red run's PR again, up to maxRunsPerHead: 3 (:84), unless the run posted its check;
      • pr-refine.yml's record-passes comment says a failed pass logs refine-failed, which monitoring signal 13 counts as a pr-refine hold.
    • Review is not blocked: wait-refine.mjs reviews on a failed Refine (refine-failure). The owner may want to weigh the red runs and re-dispatches before merge. This PR does not change that behaviour.
  • wait-for-refine's step timeout (45 min) and job timeout (50 min) in both hosted review callers are left as they are. They still bound the 1920 s worst case, and callers.test.mjs pins them. They could come down to about 35 and 40 minutes in a separate change.

Related

  • #13933 added the wait and its 2400 s cap.
  • #13717: Refine before review.

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits November 17, 2026 12:13
Claim commit for #14292; the change follows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each fix-docs call in pr-refine.yml (first, subscription, fallback)
sets its read runner's run-job timeout to 30 minutes, down from 60.
The runner gives the model leg that timeout less 15 minutes, so each
leg now stops at 15 minutes instead of 45. The runner refuses 15 or
less as a run-job timeout.

wait-refine.mjs's default cap drops from 2400 s to 1800 s, one fix-docs
run job at its timeout. The pr-pipeline README states the new cap; the
hosted review callers' comments that restated the old one are removed,
since their 45-minute wait step still bounds 1800 s plus two 60 s
confirming sleeps.

Refs: #14292

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 17, 2026 17:27
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T17:28:51.630349Z 56e20cb Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kyle-sexton kyle-sexton added do-not-merge Hard merge gate: do not merge while applied. and removed do-not-merge Hard merge gate: do not merge while applied. labels Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 56e20cbbeafd2b7a967116582eae812aa94a905d: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

The PR makes two changes:

  • It lowers the run-job timeout from 60 to 30 on all three Refine fix-docs calls in pr-refine.yml: fix-docs, fix-docs-subscription and fix-docs-fallback. The read runner gives the model leg the timeout less 15 minutes, so each leg is now capped at 15 minutes.
  • It lowers wait-refine.mjs's default capSeconds from 2400 to 1800.

The tests, the README signal row and a pr-pipeline changelog fragment are updated to match.

What I checked

  • The test loop's job lookups. The updated callers.test.mjs loop reads jobs[\${firstId}-fallback`]for everyPATCH_LANESentry. The same loop already looks up that job id at [callers.test.mjs#L3249](https://github.com/melodic-software/claude-code-plugins/blob/56e20cbbeafd2b7a967116582eae812aa94a905d/.github/actions/resolve-config/callers.test.mjs#L3249), so every entry has one and the lookup cannot throw.RUN_JOB_MINUTES[firstId] ?? 60keeps the other patch lanes, such asfix-ci`, at 60.
  • The default cap's test. Nothing sets WAIT_CAP_SECONDS in any workflow, so DEFAULTS.capSeconds is the cap in use. The readEnv test at wait-refine.test.mjs#L369-L371 compares against INPUT, whose capMs is now 1_800_000, so it pins the new default.
  • Stale mentions of the old values. None are left in the changed workflows, the pr-review scripts or the pipeline README. The CHANGELOG's "40 minutes" entry is history and correctly stays.
  • The removed comments. The two hosted-review step comments that restated the 2400 s cap are removed rather than rewritten. The 45-minute step timeout still covers 1800 s plus two 60 s confirming sleeps.

Closing issue. None: the PR uses Refs: #14292, not Closes, so I applied no acceptance criteria. The PR states that done-when item 1 (timeout-minutes: 15) cannot be met as written, because the runner rejects a timeout of 15 or less. That is left for the owner to accept and is not judged here.

Verification. The test pass counts, the actionlint and zizmor results, and "failed on the old values" are the author's claims; I did not run them. This lane has no shell.

Loosened check. The wrapper wrote no loosened_check_verdict: or loosened_check_patterns: line, so I used fail with no consumer entries. No changed file loosens a check: the timeouts and wait cap get tighter, and the test assertion now covers all three legs where it covered one. Loosened-check verdict: fail (default; no loosening found).

Spend. This draws on prepaid or subscription usage only, and it lowers it: each fix-docs model leg drops from 45 to 15 minutes and the review wait drops from 40 to 30 minutes. It is not a hold.

Verifier dropped 0 of 0 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 56e20cbbeafd2b7a967116582eae812aa94a905d: read 8 of 8 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

This PR lowers two timeouts:

  • Refine fix-docs run jobs: pr-refine.yml sets timeout-minutes: 60 → 30 on all three calls (fix-docs, fix-docs-subscription, fix-docs-fallback).
  • Hosted review wait cap: the default in wait-refine.mjs drops from 2400 s to 1800 s.

The rest of the diff updates tests, removes two comments, and updates the docs and the changelog fragment to match.

I read every hunk of all 8 changed files. Several are on trusted paths: pr-refine.yml, pr-review-hosted.yml, pr-review-security-hosted.yml, and callers.test.mjs under resolve-config/**. What I checked:

  • Trust controls are unchanged. permissions:, if: conditions, trusted-base: default-tip, head-sha sourcing and the passed secrets are the same in every changed pr-refine.yml call. Only the timeout-minutes value changed. Nothing touches the trusted-trigger check, the lane token request or broker, the kill switch or a merge hold.
  • The wait-cap change is fail-open by design and adds no new exposure. When the cap runs out, wait-refine.mjs reviews anyway (refine-timeout), as it did before. A shorter wait only means the review may run before Refine finishes. It does not skip or weaken a review, and it lets no untrusted text or code through. The DEFAULTS object is still frozen, and polling and confirmation are unchanged.
  • The callers.test.mjs change tightens a check. It used to assert the timeout on the first call only; it now asserts it on all three fix-docs calls.
  • The removed comments are not standing instructions. They are workflow comments that stated the old cap, not guardrails, so the instruction-surface lens does not apply.
  • No embedded instructions appear in the PR context.

Spend (not a hold): the shorter run-job timeouts lower the worst-case Claude API and subscription usage per Refine run. Nothing new is billed.

critical-findings: 0

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 485566b Nov 17, 2026
236 of 246 checks passed
@kyle-sexton
kyle-sexton deleted the fix/14292-refine-leg-cap branch November 17, 2026 19:00
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant