Skip to content

feat: make rate limit retry message more user-friendly#19004

Open
superdav42 wants to merge 2 commits intoanomalyco:devfrom
superdav42:feature/user-friendly-rate-limit-message
Open

feat: make rate limit retry message more user-friendly#19004
superdav42 wants to merge 2 commits intoanomalyco:devfrom
superdav42:feature/user-friendly-rate-limit-message

Conversation

@superdav42
Copy link

@superdav42 superdav42 commented Mar 24, 2026

Issue for this PR

Closes #19004

Type of change

  • New feature

What does this PR do?

This PR improves the user experience when rate limits are hit by making the retry message more readable. Instead of showing "retrying in 8143s - attempt #1", it now shows "retrying in 3h - attempt #1".

The changes:

  1. Added i18n keys for hours and minutes formatting (ui.sessionTurn.retry.inHours and ui.sessionTurn.retry.inMinutes)
  2. Updated the SessionRetry component to intelligently format delay duration based on the time elapsed (hours → minutes → seconds)

This makes it much easier for users to understand how long they need to wait before retrying, especially for longer delays.

How did you verify your code works?

I tested the logic by creating a helper function that formats delays:

  • For delays >= 3600 seconds: shows "in Xh" (e.g., "in 3h")
  • For delays >= 60 seconds: shows "in Xm" (e.g., "in 2m")
  • For delays < 60 seconds: shows "in Xs" (existing behavior)

The code follows the existing patterns in the codebase and uses the same i18n approach as other retry messages.

Screenshots / recordings

This is a UI change. Screenshots showing the before and after would be helpful for reviewers.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

- Add i18n keys for hours and minutes formatting
- Update retry message to show 'in 3h' instead of 'in 8143s'
- Format delay as hours, minutes, or seconds based on duration

Closes #<issue-number>
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 24, 2026
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Related PR:

The other results returned are either PR #19004 (the current PR) or unrelated PRs about other retry/error handling features.

No duplicate PRs found addressing the same user-friendly retry message formatting feature.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 24, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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