-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Description
The /usage command fetches API usage from the Anthropic API. When the API returns a 429 (Too Many Requests) response, the error is:
- Correctly surfaced to the user with a friendly message: "Usage API error (HTTP 429): Rate limited by Anthropic — too many requests. Try again in a minute."
- But logged at
errorlevel with a full Rich stack trace (usage.api_error), producing ~15 lines of log output per occurrence.
Impact
429 is an expected transient condition, not a bug. Logging it at error level:
- Triggers the
untether-issue-watcherauto-reporter unnecessarily - Clutters journalctl with multi-line stack traces for non-actionable events
- May mask genuine errors in log monitoring
Expected behaviour
- Log 429 at
warninglevel with a single-line message (status code + short description) - Reserve
errorlevel for unexpected failures (5xx, connection errors, auth failures) - Consider logging 4xx client errors (except 429) at
errorand 429 specifically atwarning
Affected files
src/untether/telegram/commands/usage.py
Reproduction
/usage # send 3+ times rapidly to any chat
Logs show:
[error ] usage.api_error status=429
│ ❱ 829 │ │ raise HTTPStatusError(message, request=request, response=self │
│ │ message = "Client error '429 Too Many Requests' for url ...
HTTPStatusError: Client error '429 Too Many Requests' for url ...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working