mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
[app-server] Include reset-credit details in rate limits (#30395)
## Why Supported clients currently receive only a reset-credit count from `account/rateLimits/read`. The redemption UI and other app-server clients need each available credit's expiry and ID so they can explain what will expire and consume the credit a user selected. This information belongs on the existing rate-limit read surface rather than a second app-server list RPC that clients would need to coordinate. ## What changed - extend `rateLimitResetCredits` on `account/rateLimits/read` with nullable `credits` detail rows - fetch usage and reset-credit details concurrently; if the detail request fails, times out, or cannot be parsed, preserve the usage response and return `credits: null` - expose each credit's ID, reset type, status, grant time, expiry time, title, and description - add an optional nullable `creditId` to `account/rateLimitResetCredit/consume`; omitting it preserves the existing automatic-selection behavior - forward a selected credit ID to the Codex backend and update the app-server documentation and generated schemas The TUI consumer is stacked in #30488. ## Validation - `just test -p codex-app-server-protocol` (251 passed) - `just test -p codex-backend-client` (16 passed) - `just test -p codex-app-server rate_limit` (18 passed) Part of #29618.
This commit is contained in:
24 files changed
+967
-53
No files matched your search
@@ -798,7 +798,10 @@ pub(super) async fn consume_rate_limit_reset_credit_request(
|
||||
request_handle
|
||||
.request_typed(ClientRequest::ConsumeAccountRateLimitResetCredit {
|
||||
request_id,
|
||||
params: ConsumeAccountRateLimitResetCreditParams { idempotency_key },
|
||||
params: ConsumeAccountRateLimitResetCreditParams {
|
||||
idempotency_key,
|
||||
credit_id: None,
|
||||
},
|
||||
})
|
||||
.await
|
||||
.wrap_err("account/rateLimitResetCredit/consume failed in TUI")
|
||||
|
||||
Reference in new issue
Block a user