From e596ab487d9782e4cd9633be081dc42e4a176668 Mon Sep 17 00:00:00 2001 From: kaitranntt Date: Mon, 2 Feb 2026 23:40:15 -0500 Subject: [PATCH] fix(quota): add explicit 429 rate limit handling Match pattern from quota-fetcher-codex.ts for consistent user-friendly error messages when rate limited. --- src/cliproxy/quota-fetcher.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cliproxy/quota-fetcher.ts b/src/cliproxy/quota-fetcher.ts index a2c79d41..2e965707 100644 --- a/src/cliproxy/quota-fetcher.ts +++ b/src/cliproxy/quota-fetcher.ts @@ -427,6 +427,15 @@ async function fetchAvailableModels(accessToken: string, _projectId: string): Pr }; } + if (response.status === 429) { + return { + success: false, + models: [], + lastUpdated: Date.now(), + error: 'Rate limited - try again later', + }; + } + if (!response.ok) { return { success: false,