Skip to content

Document the two 429s in the SDK and CLI READMEs - #24

Merged
spencer-zqian merged 1 commit into
mainfrom
docs/429-two-limits
Aug 4, 2026
Merged

Document the two 429s in the SDK and CLI READMEs#24
spencer-zqian merged 1 commit into
mainfrom
docs/429-two-limits

Conversation

@spencer-zqian

Copy link
Copy Markdown
Contributor

Why

RateLimitError covers two limits that want opposite handling, and the class and .code (rate_limit_exceeded) are identical for both. Only the message tells them apart, and nothing in the SDK docs said so:

  • Rate limit exceeded: your account allows 60 requests per minute. Rejected requests count toward the limit too, so wait for the next minute window (up to 60 sec) rather than retrying right away. To raise your limit, contact info@sonilo.com.
  • Too many concurrent generations: 5 of 5 in progress. Wait for one to finish before starting another. To raise your limit, contact info@sonilo.com.

A caller who backs off on a timer handles the first correctly and the second not at all — no amount of waiting frees a slot; one of their own in-flight generations has to finish.

What changed

sonilo — a "The two 429s" section under Errors, mirroring the existing "The three 402s": both sentences quoted, what each one means, where the numbers come from (account.services()rpm_limit / concurrency_limit), and the caveat that .retry_after is set only when the server sends the header — which today it does not.

sonilo-cli — a "Rate limits" section with the actual terminal output, since the CLI prints the API's sentence verbatim.

No runtime change: error_from_response already passes the message through whole. A test pins that, because it is now the property the docs depend on.

Patch bumps on both packages (0.11.1 / 0.8.1) so the READMEs reach PyPI; sonilo-cli's sonilo>=0.11.0,<0.12 pin already admits the new core, so no widening needed.

Verification

pytest237 passed in the core (2 new), 86 passed in sonilo-cli.

Companion PRs: sonilo-api-dashboard#225 (the messages and the API docs), sonilo-mcp#22, sonilo-js#41.

🤖 Generated with Claude Code

RateLimitError covers two limits that want opposite handling — slow down, or wait
for a running generation to finish — and the class and code (rate_limit_exceeded)
are identical for both. Only the message tells them apart, so the README now
quotes both sentences and says what each one means, alongside the existing "three
402s" section that makes the same point for that status.

The per-minute half also documents what the message alone cannot: the counter
runs on a fixed 60-second window and rejected requests count toward it too, so a
retry inside the window cannot succeed.

The CLI prints the API's sentence verbatim, so its README gains the same guidance
with the actual terminal output.

No runtime change: error_from_response already passes the message through whole.
A test pins that, since it is the property the docs now depend on. Patch bumps on
both packages so the READMEs reach PyPI; sonilo-cli's >=0.11.0,<0.12 pin already
admits the new core.
@sapient-app

sapient-app Bot commented Aug 4, 2026

Copy link
Copy Markdown

Sapient docs evals

Waiting for the staging docs URL before running evals.

Sapient will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes.

Commit: 3be3f90
Status: waiting for staging docs URL

@spencer-zqian
spencer-zqian merged commit 969c1f7 into main Aug 4, 2026
2 checks passed
@spencer-zqian
spencer-zqian deleted the docs/429-two-limits branch August 4, 2026 20:02
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