Skip to content

fix(runner): prevent Retry-After duration overflow - #58

Merged
steipete merged 1 commit into
mainfrom
sweep3/retry
Sep 22, 2026
Merged

steipete merged 1 commit into
mainfrom
sweep3/retry

Conversation

@steipete

@steipete steipete commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Large numeric Hugging Face Retry-After values overflowed Go’s nanosecond duration. With Retry-After: 9223372037, the client retried immediately and exhausted all six attempts instead of waiting for the server cooldown or cancellation.

Parse unsigned seconds and saturate at Go’s maximum duration before multiplication. Preserve ordinary numeric and HTTP-date cooldowns, context cancellation, and fallback behavior for malformed headers, including oversized numbers followed by junk. This addresses an overflow defect without introducing the premature-retry policy proposed in #50.

Regression proof uses a real local HTTP server: main returns HTTP 429 immediately for the overflowing header; the fix makes exactly one request and exits at the caller’s deadline. Boundary tests cover zero, a normal one-hour cooldown, both sides of the duration limit, values beyond uint64, negative values, malformed values, and HTTP dates. The focused tests were observed failing before the fix and passing afterward. Full Go tests, vet, and docs generation are required on AWS Crabbox before merge, alongside independent Codex review through P2 and exact-head CI.

Final validation passed on Go 1.27.1/Linux: go test -count=1 ./..., go vet ./..., and make docs-site on AWS Crabbox. Independent review is clean through P2 for the final diff, including malformed oversized headers.

@steipete
steipete requested review from a team and Patrick-Erichsen as code owners September 22, 2026 09:34
@clawsweeper

clawsweeper Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@steipete
steipete merged commit b3b4588 into main Sep 22, 2026
9 checks passed
@vincentkoc
vincentkoc deleted the sweep3/retry branch September 25, 2026 11:11
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.

1 participant