ci(link-check): throttle github.com to stop lychee rate-limit warning - #173
Merged
Conversation
The GITHUB_TOKEN added in #172 raises the REST API limit, but lychee still logged "Host github.com sent an unexpectedly big rate limit backoff duration of 5m. Capping the duration to 1m instead." Plain github.com web-page checks (/blob/, /tree/, /releases, anchors) don't use the API, so a burst of concurrent requests trips github.com's rate limit; the multi-minute reset it returns exceeds lychee's hardcoded 60s cap and is logged as a warning. Add a lychee.toml that throttles only github.com (concurrency 2, 1s interval) so we stay under the limit. lychee-action@v2 ships lychee v0.24.2, which supports per-host config (v0.23.0+). Other hosts are unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
--config points at it explicitly, so it needn't sit in the repo root. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The weekly External link check still logs, even after #172 added
GITHUB_TOKEN:Run 33974737077 ran on the merge commit of #172 (
5abaf21), so the token was active — it's necessary but not sufficient.Root cause
The warning comes from lychee's per-host adaptive rate limiter (
lychee-lib/src/ratelimit/host/host.rs→increase_backoff). When github.com rate-limits us, it returns a multi-minutex-ratelimit-reset; that exceeds lychee's hardcoded 60s cap (MAXIMUM_BACKOFF), so lychee caps it and warns. It only fires when we actually trip github.com's limit.The token raises the REST API limit (1,000/hr) for the repo/issue links lychee checks via the API — but plain github.com web-page checks (
/blob/,/tree/,/releases, anchors) go through the ordinary HTTP client with no token, and a burst of ~14 concurrent requests trips github.com's web rate limit.Fix
Add
lychee.tomlthrottling only github.com (concurrency = 2,request_interval = "1s") and pass--config lychee.toml. Keeps us under the limit; other hosts stay fast.lychee-action@v2ships lychee v0.24.2, which supports per-host config (added in v0.23.0).Adds ~30s to a weekly job. The job already has
fail: false, so this was only cosmetic noise.Verification
Dispatch on this branch and confirm the warning is gone:
🤖 Generated with Claude Code