Repository navigation
fix(work-resolve-issue): wait out the rate limit in handoff-evidence reads - #17324
Conversation
…reads The issue lane's handoff jobs failed with "handoff evidence ... still missing after 6 reads: the jobs read failed" when the GITHUB_TOKEN pool was empty (runs 44324786543, 44169091894, 42976995398, 42706696627). The first read got GitHub's 403, the rate guard then refused reads 2-6 without sending them, and each refusal counted as a failed read, so the job gave up about two minutes into a reset up to an hour away. The message named no rate limit, so the causes page classed all of them as defects. - handoff-evidence.sh: a read the rate guard refuses names the pool's reset in its message. A step that sets API_BUDGET_WAIT_SECONDS waits for the reset once through rate-guard.mjs's waitOut and reads again; a reset past the guard's budget ends the reads at once. Other callers keep their timing. - work-resolve-issue.yml: the four handoff-evidence steps set API_BUDGET_WAIT_SECONDS to 1200, and their jobs' timeouts grow by 20 minutes to hold the wait. Refs: #16642 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…doff error work-unblock's floor reading (label-unblocked.mjs LIMIT_COMPANION) matched the handoff error only as it ended at "the jobs read failed", so the rate-limit suffix would have stopped it re-firing these runs after the reset. It now takes the suffix too. handoff-evidence.sh ends the reads early only when the reset is past both the guard's wait budget and what is left of the reads' window, so a reset the old jittered reads could outlast still gets them. The credit-stop read is continue-on-error and never fails the run, so it takes no wait. Refs: #16642 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…GET_SECONDS The three handoff-evidence jobs' API_BUDGET_WAIT_SECONDS is WAIT_BUDGET_SECONDS.workResolveIssue in rate-guard.mjs, the line #17321 adds byte for byte. callers.test.mjs pins each job's value to it and checks its timeout holds the wait; the tests read the constant instead of a literal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review: no security issues foundI read all 6 changed files in full from Since the last review: the inline Trust-path and control checks:
The diff doesn't touch any of the owner's named friction holds, and no plugin manifest changed. Spend: the three handoff and stale jobs can now run up to 30 minutes instead of 10 on the standard critical-findings: 0 |
|
claude-review reviewed Code review: PR #17324, wait out the rate limit in handoff-evidence reads (blocking only)This lane already reviewed an earlier head (
No blocking findings. Both earlier findings are fixed on this head:
Other checks:
Closing issue: the PR only says Path-scoped rules / paved paths: no Loosened-check verdict: pass. No check is loosened: the Verification: I ran nothing. The test counts in the PR body and the owner's replies (920 and 939 pass) are author-claimed and unverified. Spend (not a hold): the three handoff jobs' I checked the candidates against the source myself and dispatched no separate verifier. Verifier dropped 0 of 0 candidates. |
|
The pr-unblock lane stopped
When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean. To run it again on this head now, dispatch the gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=17324 -f activity=address-feedback |
Lane run report
Failed GitHub API calls
|
…it waits waitOut returns at once when the reset does not fit the latch's budget, but waited_out was set before the call, so a reset just past the budget at read 1 used up the only wait and a later read, whose reset now fit, never waited. The node call now exits 3 when the latch would not wait, and waited_out is set only after a wait ran, so each later refused read tries again. The test records each latch call through a node wrapper. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refs: #16642
Summary
The issue lane's handoff jobs failed with "handoff evidence for resolve-issue-subscription still missing after 6 reads: the jobs read failed" whenever the
GITHUB_TOKENpool was empty. That ended 26 issue-lane runs on 2026-11-18 and 14 on 2026-11-17. The local causes page classed every one as a defect, because the message never said "rate limit".Cause, the same in runs 44324786543, 44169091894, 42976995398 and 42706696627:
handoff-evidence.shcounted each refusal as a failed read (max_failed=6), so the job gave up 2.0 to 2.4 minutes into the window.The reads could not succeed before the reset, and nothing waited for it.
Fix
handoff-evidence.sh:API_BUDGET_WAIT_SECONDSwaits for the reset once, throughrate-guard.mjs's existingwaitOut, then reads again, and that read does not count as failed.work-resolve-issue.yml: the steps in resolve-issue-handoff, resolve-issue-subscription-handoff and resolve-issue-stale setAPI_BUDGET_WAIT_SECONDS: "1200", and those jobs' timeouts go from 10 to 30 minutes to hold the wait. The credit-stop read iscontinue-on-errorand never fails the run, so it is unchanged.label-unblocked.mjs: work-unblock re-fires these runs after the reset by reading the handoff error as a rate-limit companion line (LIMIT_COMPANION). That pattern now also accepts the line with the rate-limit suffix, so the re-fire keeps working.The wait depends on the in-flight rate-guard work. On main,
waitOut's budget is a fixed 60 s. The 1200 s budget comes fromAPI_BUDGET_WAIT_SECONDSin the end-of-run wait change (branchfix/lane-end-steps-wait-for-reset) and the budget source in #17320. Until those merge, this PR does two things:Verification
node --testonhandoff-evidence.test.mjs,label-unblocked.test.mjs,callers.test.mjs,signals.test.mjsandcollect.test.mjs: 920 pass, 0 fail. New cases:waitOut, then reads again and writesposted=true.classify()returnsdefectfor the old line andinfrafor both new lines.scripts/check-affected.sh --tests --uncommitted: 14 passed, 122 skipped. The pre-push check-affected also passed.Related
rate-guard.mjs.fix/lane-end-steps-wait-for-resetalso editswork-resolve-issue.yml, in other jobs' hunks (the runner calls, Run Checks, Report Statuses).🤖 Generated with Claude Code