Skip to content

feat(usage): check limits when a limit stop has no reset time - #60

Draft
wSedlacek wants to merge 1 commit into
mainfrom
t3/retry-usage-limit-fetch
Draft

wSedlacek wants to merge 1 commit into
mainfrom
t3/retry-usage-limit-fetch

Conversation

@wSedlacek

Copy link
Copy Markdown

Reopened from closed upstream PR pingdotgg#31691 as a draft for t3.1code.
Idea rank: 59 of 108. Branch is as it was upstream; it likely needs a rebase (modernize) before review.

Problem

When a thread stops at a usage limit and the provider reports no reset time, the banner only says the reset time is unavailable and asks the user to retry manually. There is no way to see the provider's current limits from that banner. The user has to leave the thread and open /usage-limits or Usage → Limits to find out whether a window has reset.

Change

  • Web and desktop: the "Usage limit reached" banner shows a Check limits button when the reset time is unknown. The button refreshes providers, shows "Checking..." while it runs, then opens the same limits panel as /usage-limits. If the check fails or the provider reports no limits, a toast explains why.
  • Mobile: UsageLimitRecoveryCard shows the same Check limits button in the same case. Errors appear inline on the card.
  • Both clients call the existing refreshUsageLimits path from client-runtime, so a check already running for the environment is reused instead of started twice.
  • The button is hidden when the connection lacks permission for serverEnvironment.refreshProviders. The server remains the authority for that check.
  • The ChatGPT usage-limit banners keep their current actions, which follow OpenAI's partner guidelines.
  • Added a short note to docs/user/usage.md.

This does not save the checked reset time on the thread, so Resume at reset and Snooze until reset still do not appear after a check. Supporting that would need a server change.

Scope and approval

No linked issue or discussion. This is a small addition to the existing usage-limits refresh: it reuses the /usage-limits data path and only changes the banner shown when the reset time is missing. It adds one user-facing action, so a maintainer should confirm that the direction fits before merging.

Verification

  • vp test run on UsageLimitRecoveryBanner.test.tsx and UsageLimitRecoveryCard.test.tsx passes (12 tests). The new cases check that the button appears only when the reset time is unknown, and that a failed check shows its error on mobile.
  • vp run check:changed passes after running vp fmt on the changed files. The first run failed the format step, and the rerun was clean.
  • Not checked: I did not click through the flow in a running web, desktop, or mobile client. Reaching it needs a thread stopped at a usage limit with no reset time. Before/after captures are still needed for the banner and the mobile card.

Model and harness: Claude, through Claude Code (claudeAgent provider).

🤖 Generated with Claude Code

Reopened from pingdotgg#31691 and squashed onto current main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wSedlacek
wSedlacek force-pushed the t3/retry-usage-limit-fetch branch from 44f2ea9 to 1ca9484 Compare November 14, 2026 22:38
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L labels Nov 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant