Skip to content

Fix ClawHub install rate limiting by preferring /file endpoint#489

Open
mccar2cm wants to merge 1 commit intoRightNow-AI:mainfrom
mccar2cm:fix/clawhub-install-rate-limit
Open

Fix ClawHub install rate limiting by preferring /file endpoint#489
mccar2cm wants to merge 1 commit intoRightNow-AI:mainfrom
mccar2cm:fix/clawhub-install-rate-limit

Conversation

@mccar2cm
Copy link

Summary

  • ClawHub's /download endpoint has a 20 req/window rate limit shared across IPs, causing skill installs to fail with 429 even on the first attempt (common on shared hosting/VPS)
  • The /file endpoint has a 120 req/window limit and returns SKILL.md content directly — sufficient for the majority of ClawHub skills
  • Now tries /skills/{slug}/file?path=SKILL.md first, falls back to /download only for non-SKILL.md packages (zips, Node.js)
  • Respects the retry-after header on 429 responses instead of fixed exponential backoff
  • Dashboard now shows the actual server error message on 500s instead of the generic "Server error — check daemon logs"

Test plan

  • Install a SKILL.md-based skill from ClawHub (e.g., agentmail) — should succeed via /file endpoint
  • Install a non-SKILL.md skill (zip/package) — should fall back to /download
  • Verify cargo test --workspace passes (1886 tests)
  • Verify cargo clippy --workspace --all-targets -- -D warnings is clean
  • Trigger a 500 error in dashboard and verify the real error message is shown

🤖 Generated with Claude Code

The /download endpoint has a 20 req/window rate limit shared across
all users on the same IP, causing installs to fail with 429 on the
first attempt. The /file endpoint has a 120 req/window limit and
returns SKILL.md content directly — sufficient for most skills.

Changes:
- Try /skills/{slug}/file?path=SKILL.md first, fall back to /download
- Respect retry-after header instead of fixed exponential backoff
- Show actual server error messages in dashboard instead of generic text

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Avey777
Copy link

Avey777 commented Mar 10, 2026

#492

@jaberjaber23 jaberjaber23 added the under-review PR is under review label Mar 11, 2026
@jaberjaber23
Copy link
Member

thanks for this! we already implemented ClawHub rate limit retry with 5-attempt exponential backoff + jitter in v0.3.44 (fix for #492). appreciate the contribution

@Avey777
Copy link

Avey777 commented Mar 11, 2026

thanks for this! we already implemented ClawHub rate limit retry with 5-attempt exponential backoff + jitter in v0.3.44 (fix for #492). appreciate the contribution

Is it because the project is still in the early stages? Would it be better to accept community contributions?

@mccar2cm
Copy link
Author

No worries - I liked the idea of hitting the files endpoint then the download. Take a look, see if you think that is an interesting approach.

@Avey777
Copy link

Avey777 commented Mar 11, 2026

image

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

Labels

under-review PR is under review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants