Skip to content

ci(link-check): throttle github.com to stop lychee rate-limit warning - #173

Merged
Arthurvdv merged 2 commits into
mainfrom
worktree-ci+lychee-github-throttle
Sep 5, 2026
Merged

ci(link-check): throttle github.com to stop lychee rate-limit warning#173
Arthurvdv merged 2 commits into
mainfrom
worktree-ci+lychee-github-throttle

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Problem

The weekly External link check still logs, even after #172 added GITHUB_TOKEN:

[WARN] Host github.com sent an unexpectedly big rate limit backoff duration of 5m. Capping the duration to 1m instead.

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.rsincrease_backoff). When github.com rate-limits us, it returns a multi-minute x-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.toml throttling only github.com (concurrency = 2, request_interval = "1s") and pass --config lychee.toml. Keeps us under the limit; other hosts stay fast. lychee-action@v2 ships 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:

gh workflow run "External link check" --repo ALCops/alcops.dev --ref worktree-ci+lychee-github-throttle

🤖 Generated with Claude Code

Arthurvdv and others added 2 commits September 5, 2026 17:36
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>
@Arthurvdv
Arthurvdv merged commit 7508662 into main Sep 5, 2026
2 checks passed
@Arthurvdv
Arthurvdv deleted the worktree-ci+lychee-github-throttle branch September 5, 2026 15:40
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