Commit Graph
17 Commits
Author SHA1 Message Date
Julius Marminge 1f14d6d10a fix(usage): keep account columns aligned across limit rows (#10690) 2026-09-08 00:40:35 -07:00
Julius Marminge 6ba15c027a fix: hide email-bearing account labels in usage limits (#10668) 2026-09-07 21:01:48 -07:00
Julius Marminge 0a89364f15 fix(usage): read and redeem hub reset credits through CLIProxyAPI (#10395) 2026-09-06 16:30:10 -07:00
Julius Marminge b155c2199b feat(mobile): pool usage limits across selected environments (#10334) 2026-09-06 00:57:43 -07:00
Wout StiensandJulius Marminge f12d39359f fix(ui): unify loading and refresh feedback across clients (#9561)
Co-authored-by: Julius Marminge <[email protected]>
2026-09-05 16:26:02 -07:00
Chris DeemingandJulius Marminge be53bbd850 feat(usage): show remaining quota instead of used (#9889)
Co-authored-by: Julius Marminge <[email protected]>
2026-09-05 16:22:15 -07:00
Chris Deeming 183c343309 feat: show provider usage limits with /usage-limits (#9875) 2026-09-05 16:17:36 -07:00
Julius Marminge ac90950f1a fix(mobile): keep usage tabs below the header when switching (#9876) 2026-09-04 19:53:45 -07:00
Julius MarmingeandClaude Fable 5 24aef0e6c1 feat(mobile): split the usage page into Usage and Limits tabs (#9775)
Co-authored-by: Claude Fable 5 <[email protected]>
2026-09-04 14:10:30 -07:00
Julius Marminge f1e90e388b refactor(web): move usage provider controls to settings (#9599) 2026-09-03 23:56:23 -07:00
Julius Marminge b34ff8f564 fix(usage): deduplicate CLI proxy subscription accounts (#9584) 2026-09-03 21:38:45 -07:00
1641b4aba5 feat(usage): redeem Codex reset credits from the Limits tab (#9534)
Follow-up to #9507, carrying over the reset-credit redemption from #9421.

Codex grants a reset credit when it has rate-limited an account unfairly (`"Thanks for using Codex! You've been granted one free rate limit reset."`). Redeeming one clears the current 5h/weekly windows. The Limits tab now shows how many are banked and when the next expires, with a confirmed **Use a reset credit** action.

## How it works

- `ServerProviderUsageLimits.resetCredits` carries the count and soonest expiry; the Codex probe reads it from the same `account/rateLimits/read` it already makes.
- `ProviderInstance.consumeResetCredit` is a new optional hook — account-level, so it sits beside `refreshModels` rather than on the thread-routed adapter. The Codex driver implements it over a short-lived app-server (via `withCodexAppServerClient`, factored out of the status and skills probes which duplicated the setup), then re-probes.
- Single-flight per instance with one idempotency key kept until Codex reports an outcome, so a retry after a timeout does not open a second attempt.
- New `provider.consumeResetCredit` RPC under the operate scope; the outcome (`reset` / `nothingToReset` / `noCredit` / `alreadyRedeemed`) is shown inline.

Only Codex reports credits today. A provider without the hook gets a clear "does not bank reset credits" error; one without credits shows nothing.

## Screenshots

The local Codex row with one banked credit (the same account via the CLIProxyAPI hub above it shows no credit, as expected — the hub does not relay them):

![Limits tab with the Codex row showing "1 reset credit banked · next expires in 16d 22h" and a "Use a reset credit" button](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2897db5e357f12b3/credits-tab.png)

Close-up of the row:

![Codex row: Weekly 25% used bar, then "1 reset credit banked · next expires in 16d 22h" with the "Use a reset credit" button](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/0e80f9114cab8f36/credits-row.png)

Clicking it opens the confirmation; nothing is sent until **Use credit**:

![Confirm dialog: "Use a reset credit? This redeems one credit on your account and clears the current rate-limit windows. It cannot be undone." with Cancel and Use credit](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/dc728580889ef1fe/credits-confirm.png)

## Verification

- Mapper tests for the credit summary; provider, contract, and Usage page suites pass; typecheck clean.
- Verified against a real Codex Pro account holding one credit: summary and expiry render, the confirm dialog opens. **Not redeemed** — that would spend the credit.

Written by Claude Fable 5 via Claude Code; design and single-flight approach from @StiensWout's #9421.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Redemption spends real account credits over a new RPC; correctness depends on per-account locking and idempotency, though disabled instances and non-Codex providers are rejected explicitly.
> 
> **Overview**
> Adds **end-to-end redemption of banked Codex rate-limit reset credits** from the Limits UI on web and mobile, backed by a new operate-scoped `provider.consumeResetCredit` RPC.
> 
> **Contracts and server:** `ServerProviderUsageLimits` can include `resetCredits` (count + next expiry). Codex probes attach that from `account/rateLimits/read`. Optional `ProviderInstance.consumeResetCredit` is implemented for Codex via a scoped app-server call to `account/rateLimitResetCredit/consume`, then a limits refresh. `CodexResetCreditCoordinator` serializes redemptions per Codex account directory, reuses one idempotency key until Codex returns an outcome, and times out hung requests. `withCodexAppServerClient` is extracted so status, skills, and redemption share the same short-lived app-server setup.
> 
> **Clients:** Limits rows show banked credits and a confirmed **Use a reset credit** action that calls `serverEnvironment.consumeResetCredit` and surfaces outcomes (`reset`, `nothingToReset`, etc.) or errors.
> 
> **Web usage sources (same PR):** Adding/removing CLIProxyAPI hubs and the add dialog target a **selected connected environment** (with picker when several are connected), gated by operate access—not only the primary environment.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 98f32e60852dca1d38c94335b3ed7aac8c4b895e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->


Co-authored-by: Wout Stiens <[email protected]>
Co-authored-by: Claude Code <[email protected]>
2026-09-03 19:14:29 -07:00
19d8ab2ae9 feat(usage): show Codex and Claude subscription limits on a Limits tab (#9507)
Users on Codex or Claude Code subscriptions could not see how much quota was left or when it resets without leaving T3 Code. A user whose CLIs route through a CLIProxyAPI hub could not see it at all.

Each driver now returns `usageLimits` on its own snapshot (Codex from `account/rateLimits/read`, Claude from the SDK's `get_usage`), adapters normalise turn-driven rate-limit events at the boundary, and a driver-blind ingestion layer folds them onto the owning instance. The Usage page gains a Limits tab (mobile a card) with a bar per window, elapsed marker, pace, and reset countdown. CLIProxyAPI hubs can be added as read-only usage-limit sources; their accounts show badged "via CLIProxyAPI" with emails blurred.

Distilled from #1732 (server model, provider rows) and #9421 (Limits tab, window bars, pace maths). Closes #228.

Co-authored-by: Aditya Mer <[email protected]>
Co-authored-by: Wout Stiens <[email protected]>
Co-authored-by: Claude Code <[email protected]>
2026-09-03 17:47:54 -07:00
ead4ce52a1 fix(grok): improve skills, plans, usage, and turn reliability (#8358)
Co-authored-by: Dara Adedeji <[email protected]>
Co-authored-by: Ahmed Besic <[email protected]>
Co-authored-by: Michael Brown <[email protected]>
Co-authored-by: Lars Nieuwenhuis <[email protected]>
Co-authored-by: Guilherme Barros <[email protected]>
Co-authored-by: PC <pc@localhost>
Co-authored-by: 1xpixi <[email protected]>
2026-08-26 23:57:46 -07:00
Chris Deeming d23b181da0 feat(mobile): add built-in themes (#6619) 2026-08-16 10:13:15 +02:00
Julius Marminge c842c6f5b9 Add hourly past-24-hour usage view (#6170) 2026-08-11 16:47:13 +02:00
Julius Marminge 1a003e383a Add cross-platform mobile usage dashboard (#5743) 2026-08-09 12:10:27 +02:00