jif
102fc57e4a
Distinguish HTTP quota errors from rate limits ( #44492 )
...
## Why
HTTP 429 responses for exhausted quota, credit balances, and spending or usage limits were reported as retry-limit failures instead of usage-limit errors.
## What changed
Parse the API error's `code` and map `insufficient_quota`, `credit_balance_exhausted`, `organization_spend_limit_exceeded`, `project_spend_limit_exceeded`, and `organization_usage_limit_exceeded` to `CodexErr::QuotaExceeded`. Also recognize `insufficient_quota` in the error's `type` field.
## Testing
Add a regression test covering all recognized quota errors and verifying that `rate_limit_exceeded` and `slow_down` HTTP 429 errors retain their existing retry-limit mapping.
GitOrigin-RevId: b075dba199e08d29563630f5ada846e3e7fd11ff
2026-09-10 10:31:15 +00:00
..
2026-09-05 18:06:26 +00:00
2026-09-10 00:41:38 +00:00
2026-09-10 09:50:59 +00:00
2026-09-07 19:34:23 +00:00
2026-09-09 20:39:33 +00:00
2026-09-09 23:23:59 +00:00
2026-09-03 06:02:25 +00:00
2026-09-09 23:59:14 +00:00
2026-08-31 13:44:12 +00:00
2026-08-31 13:44:12 +00:00
2026-09-03 23:20:54 +00:00
2026-09-09 03:17:48 +00:00
2026-09-02 21:50:51 +00:00
2026-09-07 16:55:06 +00:00
2026-09-09 19:22:22 +00:00
2026-09-02 20:07:11 +00:00
2026-09-03 01:46:37 +00:00
2026-08-28 19:44:50 +00:00
2026-08-29 02:52:58 +00:00
2026-09-01 17:17:45 +00:00
2026-09-01 01:00:50 +00:00
2026-09-08 17:51:40 +00:00
2026-09-10 10:31:15 +00:00
2026-09-10 01:05:56 +00:00
2026-09-05 01:25:06 +00:00
2026-09-10 06:06:21 +00:00
2026-08-31 21:27:51 +00:00
2026-09-08 19:56:25 +00:00
2026-09-04 23:56:25 +00:00
2026-09-10 10:23:20 +00:00
2026-09-03 23:20:54 +00:00
2026-09-02 18:34:27 +00:00
2026-09-05 12:17:32 +00:00
2026-09-07 17:09:04 +00:00
2026-09-09 17:03:57 +00:00
2026-09-07 16:55:06 +00:00
2026-09-10 09:50:59 +00:00
2026-09-02 15:07:11 +00:00
2026-09-10 03:18:28 +00:00
2026-09-09 15:12:19 +00:00
2026-08-27 20:44:47 +00:00
2026-09-06 20:52:29 +00:00
2026-09-09 15:48:39 +00:00
2026-09-09 23:23:59 +00:00
2026-09-10 00:26:30 +00:00
2026-09-08 19:40:43 +00:00
2026-09-01 15:12:53 +00:00
2026-09-09 19:43:41 +00:00
2026-09-09 23:46:17 +00:00
2026-09-09 20:32:57 +00:00
2026-09-10 03:18:28 +00:00
2026-09-09 03:17:48 +00:00
2026-09-10 03:18:28 +00:00
2026-09-09 20:02:40 +00:00
2026-09-09 17:45:17 +00:00
2026-09-09 15:48:39 +00:00
2026-09-01 17:17:45 +00:00
2026-09-05 12:08:18 +00:00
2026-09-10 08:57:35 +00:00
2026-09-07 20:25:30 +00:00
2026-08-26 17:45:42 +00:00
2026-09-10 00:14:43 +00:00
2026-09-09 23:23:59 +00:00
2026-08-28 01:14:02 +00:00
2026-09-04 20:09:04 +00:00
2026-09-09 06:04:59 +00:00
2026-09-09 04:00:10 +00:00
2026-09-05 05:21:42 +00:00
2026-09-09 23:23:59 +00:00
2026-09-02 18:34:27 +00:00
2026-09-08 04:35:21 +00:00
2026-09-10 00:30:27 +00:00
2026-09-09 23:46:17 +00:00
2026-09-10 06:06:21 +00:00
2026-09-02 18:42:06 +00:00
2026-09-08 00:13:28 +00:00
2026-09-09 17:55:00 +00:00
2026-09-08 04:55:29 +00:00
2026-09-03 20:01:07 +00:00
2026-09-09 22:50:03 +00:00
2026-09-02 22:19:51 +00:00
2026-09-08 23:37:26 +00:00
2026-09-08 21:19:02 +00:00
2026-09-09 20:02:40 +00:00
2026-09-09 17:31:37 +00:00
2026-09-04 05:07:02 +00:00