Skip to content

Comments

feat(happy-app): show rate limit / quota feedback prominently#696

Open
davidrimshnick wants to merge 1 commit intoslopus:mainfrom
davidrimshnick:feat/usage-limit-feedback
Open

feat(happy-app): show rate limit / quota feedback prominently#696
davidrimshnick wants to merge 1 commit intoslopus:mainfrom
davidrimshnick:feat/usage-limit-feedback

Conversation

@davidrimshnick
Copy link

Summary

  • Detect rate limit and quota exhaustion messages from any backend (Claude, Gemini, Codex) and display them as visually distinct limit-reached events
  • Parse patterns like "quota exceeded", "rate limit exceeded", "resource exhausted", "rate_limit_error" etc.
  • Render limit-reached events with a warning-styled banner (yellow background) instead of plain text that blends in
  • Made endsAt optional in the limit-reached schema so backends without a reset timestamp (e.g. Gemini) can still surface limit info
  • Added usageLimitReached i18n key to all 11 language files

Previously, Gemini quota messages were sent as regular text and didn't stand out. Claude limit messages were parsed but only with the exact "Claude AI usage limit reached|{timestamp}" format. Now both are handled uniformly.

Closes #662

Test plan

  • Claude AI usage limit message parsed into limit-reached event with timestamp (1 test)
  • Gemini quota exceeded message converted to limit-reached event (1 test)
  • Generic rate limit exceeded message detected (1 test)
  • Regular messages not falsely matched (2 tests)
  • isRateLimitMessage detects 7 different rate limit patterns (7 tests)
  • Case insensitive matching (1 test)
  • No false positives on similar words (1 test)
  • All 14 tests pass, typecheck passes

🤖 Generated with Claude Code

…nently

Parse rate limit and quota exhaustion messages from any backend (Claude,
Gemini, Codex) and display them as visually distinct limit-reached events
with a warning-styled banner instead of plain text.

- Extend messageToEvent parser to detect generic rate limit patterns
  (quota exceeded, resource exhausted, rate_limit_error, etc.)
- Make limit-reached schema flexible: endsAt is now optional, message
  field added for backends that provide descriptive text without a
  specific reset timestamp
- Render limit-reached events with warning background color for
  visual emphasis
- Add usageLimitReached i18n key to all 11 language files
- Add 14 tests for parser and isRateLimitMessage detection

Closes slopus#662

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Usage limitation hit has no feedback

1 participant