Summary
The Usage → Limits page already renders each provider's subscription quota windows and banked reset credits (Codex account/rateLimits/read + provider.consumeResetCredit). The provider editor in Settings → Providers said nothing about them, so checking your Codex limits or redeeming a banked reset meant leaving Settings.
This reuses the existing block in the provider editor as a Usage limits section.
Changes
UsageLimits.tsx: extract ProviderUsageLimitsBlock (windows + reset credits) from ProviderLimits; add a readOnly gate on the redeem button. The Usage page renders exactly what it did before.
ProviderInstanceCard.tsx: optional usageLimits slot, rendered as a "Usage limits" section after Setup (editor mode only).
ProviderSettingsPanel.tsx: pass the block when the live provider reports usageLimits. Skipped when unavailable.reason === "unsupported" (API-key accounts) so Settings stays quiet; probe failures still surface. Redeem follows the panel's readOnly.
- Tests: two regression cases in
ProviderSettingsPanel.environment.test.tsx.
No server or contract changes. Works with a plain codex login (ChatGPT) account; nothing here depends on CLIProxyAPI sources.
Before / After
Before: Settings → Providers → Codex shows Display name / Runtime / Environment / Models only.
After: a "Usage limits" section between Setup and Runtime with the 5h / weekly bars, pace glyph, reset countdown, and (when banked) "N reset credits banked · next expires in … [Use a reset credit]" behind the existing confirm dialog.
(Screenshots to follow.)
Verification
pnpm --filter @t3tools/web typecheck
vp test run --project unit on components/settings + components/usage: 28/28
- Manually verified in the dev app against a real Codex account.
Note
Low Risk
Web-only UI reuse of existing consumeResetCredit flow; redeem is gated by the same read-only permissions as other provider settings.
Overview
Settings → Providers now shows the same subscription quota windows and banked reset credits as Usage → Limits, so users can check Codex-style limits or redeem credits without leaving the provider editor.
ProviderUsageLimitsBlock is extracted from the Usage page layout (windows, notices, reset credits) and passed into ProviderInstanceCard as a new Usage limits section between Setup and Runtime. The panel only renders it in editor mode when the live provider reports usageLimits, and skips drivers marked unavailable.reason === "unsupported". Use a reset credit respects the settings panel’s readOnly flag (disabled when the session can’t operate).
The Usage → Limits page still uses the shared block inside ProviderLimits with the account heading unchanged. Two environment tests cover presence, read-only wiring, and omission when limits are missing or unsupported.
Reviewed by Cursor Bugbot for commit 5c9dc16. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add usage limits and reset credits to provider settings cards
- Extracts
ProviderUsageLimitsBlock from ProviderLimits in UsageLimits.tsx so limit windows, notices, and reset credits render as a standalone block without the account heading
- Passes a new optional
usageLimits ReactNode prop to ProviderInstanceCard in ProviderInstanceCard.tsx, rendered as a "Usage limits" section between setup and runtime
EnvironmentProviderSettings in ProviderSettingsPanel.tsx supplies the block only to editor-mode cards with a live provider whose limits are not marked unsupported; list-mode cards and unsupported providers get no content
ResetCredits gains an optional readOnly prop that disables the redemption button alongside the existing busy state
- Adds tests covering both the presence and omission of usage limits across providers
- Risk:
ProviderLimits wrapper in UsageLimits.tsx now checks for absent usage limits before rendering; any caller relying on the section always rendering even with no limits data will see it omitted
📊 Macroscope summarized 5c9dc16. 3 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted
🗂️ Filtered Issues