Skip to content

feat(action): retry the same credential once on a genuine short-lived rate limit - #60

Merged
Mearman merged 1 commit into
mainfrom
feat/retry-on-genuine-rate-limit
Sep 11, 2026
Merged

feat(action): retry the same credential once on a genuine short-lived rate limit#60
Mearman merged 1 commit into
mainfrom
feat/retry-on-genuine-rate-limit

Conversation

@Mearman

@Mearman Mearman commented Sep 11, 2026

Copy link
Copy Markdown
Member

Adds retry_on_rate_limit (on by default) and rate_limit_retry_wait_seconds (default 60).

Falling through to the next configured credential is the right response to a hard quota exhaustion (an account's weekly/monthly usage cap, which no wait inside this job can lift), but the wrong one for a genuine short-lived rate limit (too many requests in a short window, which a brief wait clears) -- moving to a different account for that either burns a fallback credential unnecessarily or, with none configured, fails a run a short wait would have completed.

After any credential attempt fails, a new "Rate-limit retry gate" step reads that attempt's own execution_file output and checks whether the failure was a 429 whose message does not name a multi-day-scale reset ("weekly limit", "monthly limit", and similar). A plain 429 with no such wording is treated as a genuine rate limit worth waiting out; one that does name a quota reset falls straight through to the next credential exactly as before. When retryable, this waits rate_limit_retry_wait_seconds and reruns that exact same credential once, before falling through only if the retry also fails.

This is a single, bounded retry per credential slot, not a configurable count -- like the fallback chain itself, a composite action has no native loop, so it's implemented as one more statically-unrolled gate-and-retry pair per slot (retry_gate_N / attempt_N_retry), mirroring how the existing attempt_1..5 fallback chain is itself built. Wired through action.yml's input validation, every attempt's own if: condition (now checking whether either the attempt or its retry succeeded before falling through), the "Resolve Claude Code result" winner selection across all ten attempt/retry slots, and the three reusable workflows' passthrough inputs.

Verified statically (no live credential available to exercise this end-to-end right now -- see below): YAML parses, every embedded bash script passes bash -n, actionlint against both the three real reusable workflows and a synthetic workflow_call wrapper around the composite action's own steps reports zero errors (only pre-existing shellcheck style notes), and prettier/eslint are clean.

Prompted by triaging PR #58's own claude-review dogfooding check, which failed on a real weekly-quota 429 -- confirmed to be quota exhaustion, not a genuine rate limit, so this feature wouldn't have changed that specific outcome, but surfaced the gap.

… rate limit

Add retry_on_rate_limit (on by default) and rate_limit_retry_wait_seconds (default 60).
After any credential attempt fails, a new "Rate-limit retry gate" step reads that
attempt's own execution output and checks whether the failure was a 429 whose message
does not name a multi-day-scale reset ("weekly limit", "monthly limit", and similar).
A plain 429 with no such wording is treated as a genuine, short-lived rate limit worth
waiting out; one that does name a quota reset is left to fall straight through to the
next configured credential exactly as before, since no amount of waiting inside this
job would clear it.

When the gate judges a failure retryable, this waits the configured seconds and
reruns that exact same credential once via a new retry step, before falling through
to the next credential (or giving up) only if that retry also fails. This sits
alongside the existing credential-fallback chain rather than replacing it: fallback
already moves to a different account on any failure regardless of cause, which is
correct for a quota exhaustion but wastes a momentarily-throttled credential, or
fails a run outright with no fallback configured, on a rate limit a short wait
would have cleared.

Implemented as one more statically-unrolled gate-and-retry pair per credential slot
(a composite action has no native loop, matching how the existing fallback chain is
itself implemented), and wired through action.yml's validation, the "Resolve Claude
Code result" winner selection across every attempt/retry slot, and the three
reusable workflows' passthrough inputs.
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

❌ Claude's run did not complete (outcome: failure). View job run

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-11T10:13:32.696367Z cf7eadd PR opened
ℹ️ 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.

@github-actions

Copy link
Copy Markdown

🗜️ Headroom context compression

Metric Value
Requests proxied 6
Tokens saved 4050
Aggregate savings 1.1% of all tokens sent
Average per-request compression 1.8%

@Mearman
Mearman merged commit 985aa0e into main Sep 11, 2026
11 of 12 checks passed
@Mearman
Mearman deleted the feat/retry-on-genuine-rate-limit branch September 11, 2026 11:32
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.12.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant