Skip to content

fix(ui): add dedicated error message for API rate limit (429)#1407

Open
howardpen9 wants to merge 1 commit intoMoonshotAI:mainfrom
howardpen9:fix/rate-limit-error-message
Open

fix(ui): add dedicated error message for API rate limit (429)#1407
howardpen9 wants to merge 1 commit intoMoonshotAI:mainfrom
howardpen9:fix/rate-limit-error-message

Conversation

@howardpen9
Copy link
Contributor

@howardpen9 howardpen9 commented Mar 11, 2026

Summary

  • Add a specific, user-friendly error message when API rate limit (HTTP 429) is hit and retries are exhausted
  • Applied to both shell UI and print UI, consistent with existing 401/402/403 handling
  • Uses [yellow] styling (warning, not error) since the issue is transient and recoverable

Context

Reported in #1383 — users hitting rate limits see a generic LLM provider error: ... message, which doesn't clearly explain the cause or suggest what to do. The 429 case was missing from the status-code-specific error handling that already covers 401 (auth), 402 (membership expired), and 403 (quota exceeded).

Changes

  • src/kimi_cli/ui/shell/__init__.py: Add elif branch for e.status_code == 429 with actionable message
  • src/kimi_cli/ui/print/__init__.py: Add same 429 handling + import APIStatusError

Test plan

  • Verify 429 branch is consistent with existing error handling pattern
  • Both shell and print UIs updated

Open with Devin

Previously, 429 errors showed a generic "LLM provider error" message
after retries were exhausted. This adds a clear, actionable message
for both shell and print UIs, consistent with how 401/402/403 are
already handled.

Closes MoonshotAI#1383
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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