Skip to content

fix(build): improve asset download resilience against rate limits#1201

Merged
John-David Dalton (jdalton) merged 1 commit intomainfrom
fix/asset-download-rate-limiting
Apr 15, 2026
Merged

fix(build): improve asset download resilience against rate limits#1201
John-David Dalton (jdalton) merged 1 commit intomainfrom
fix/asset-download-rate-limiting

Conversation

@jdalton
Copy link
Copy Markdown
Contributor

@jdalton John-David Dalton (jdalton) commented Apr 15, 2026

Summary

  • Increase GitHub release cache TTL from 1h to 4h to reduce API calls during repeated builds
  • Use exponential backoff (factor 2) instead of linear retries for GitHub API requests
  • Add SKIP_ASSET_DOWNLOAD env var to skip downloads when assets are already cached locally

The SKIP_ASSET_DOWNLOAD=1 toggle is useful when:

  • Repeated local builds exhaust GitHub API rate limits
  • Pre-commit hooks trigger rebuilds with cached assets
  • Working offline with previously downloaded assets

Test plan

  • Build succeeds with downloads
  • All tests pass
  • Test SKIP_ASSET_DOWNLOAD=1 pnpm build uses cached assets

Note

Low Risk
Low risk build-infra behavior changes limited to caching/retry timings and an opt-in environment flag; main risk is stale release metadata for up to 4 hours or unintentionally skipping downloads when the env var is set.

Overview
Build asset fetching now makes fewer GitHub API calls by increasing the releases cache TTL from 1 hour to 4 hours.

GitHub API retries for release listing and asset URL lookup switch to exponential backoff (backoffFactor: 2, shorter base delay) to better handle rate limits.

The CLI asset downloader supports SKIP_ASSET_DOWNLOAD to bypass all downloads (useful for cached/offline builds).

Reviewed by Cursor Bugbot for commit 5241c44. Configure here.

@jdalton John-David Dalton (jdalton) force-pushed the fix/asset-download-rate-limiting branch from 5241c44 to eb2878a Compare April 15, 2026 00:37
- Increase GitHub release cache TTL from 1h to 4h to reduce API calls
- Use exponential backoff (factor 2) instead of linear retries
- Add SKIP_ASSET_DOWNLOAD env var to skip downloads when assets are
  already cached locally (avoids rate limit exhaustion during repeated
  local builds and pre-commit hook reruns)
- Simplify cli package.json placeholder version to 0.0.0
@jdalton John-David Dalton (jdalton) force-pushed the fix/asset-download-rate-limiting branch from eb2878a to 3822f57 Compare April 15, 2026 02:25
@jdalton John-David Dalton (jdalton) merged commit 8fc3518 into main Apr 15, 2026
13 checks passed
@jdalton John-David Dalton (jdalton) deleted the fix/asset-download-rate-limiting branch April 15, 2026 03:19
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.

2 participants