Skip to content

fix: surface clear rate-limit error for registry 429 responses - #72

Closed
knoxgraeme wants to merge 1 commit into
mainfrom
claude/elegant-curie-9xlsy2
Closed

knoxgraeme wants to merge 1 commit into
mainfrom
claude/elegant-curie-9xlsy2

Conversation

@knoxgraeme

Copy link
Copy Markdown
Owner

Summary

Fixes #71 — skillfish submit (and skillfish search) showed a confusing "Registry returned non-JSON response (HTTP 429)" message when the registry rate-limited the request.

Root cause: The non-JSON content-type guard ran before any HTTP-status check. A 429 body is typically plain text / HTML, so it fell into the generic non-JSON branch instead of producing a useful rate-limit message.

Fix:

  • Added an explicit res.status === 429 check before the content-type guard in both submitSkillsToRegistry and searchSkillsInRegistry in src/lib/registry.ts
  • Returns "Registry rate limit exceeded (HTTP 429). Please try again later." (or "Try again in N seconds." when a Retry-After header is present)

Test plan

  • New src/__tests__/registry.test.ts covers both functions: clear error on bare 429, and Retry-After seconds hint
  • All 246 existing tests still pass (npm test)
  • TypeScript clean (npm run typecheck)

🤖 Generated with Claude Code

https://claude.ai/code/session_01AYmsc1aJ2VicCXfjxTAyRs


Generated by Claude Code

When the registry returns HTTP 429, the body is often non-JSON (plain
text / HTML). The previous code hit the generic content-type check first,
producing the confusing "Registry returned non-JSON response (HTTP 429)"
message. Now a dedicated 429 check runs before the content-type guard in
both submitSkillsToRegistry and searchSkillsInRegistry, yielding
"Registry rate limit exceeded (HTTP 429). Please try again later." with
an optional seconds hint when a Retry-After header is present.

Fixes #71

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AYmsc1aJ2VicCXfjxTAyRs
@knoxgraeme knoxgraeme closed this Jun 17, 2026
@knoxgraeme
knoxgraeme deleted the claude/elegant-curie-9xlsy2 branch June 17, 2026 21:58
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.

Submission throwing 429

2 participants