Merge pull request #422 from kaitranntt/kai/fix/quota-forbidden-ux

fix(quota): improve 403 error messaging for forbidden accounts
This commit is contained in:
Kai (Tam Nhu) Tran
2026-02-02 12:02:04 -05:00
committed by GitHub
4 changed files with 11 additions and 2 deletions
+4 -1
View File
@@ -253,13 +253,16 @@ export async function fetchCodexQuota(
}
if (response.status === 403) {
// 403 = account lacks API access (not same as quota exhausted)
// Keep success=false with isForbidden flag for UI to show distinct "403" badge
return {
success: false,
windows: [],
planType: null,
lastUpdated: Date.now(),
error: 'Quota access not available (free plan may not have quota API access)',
error: '403 Forbidden - No quota API access',
accountId,
isForbidden: true,
};
}
+3 -1
View File
@@ -407,12 +407,14 @@ async function fetchAvailableModels(accessToken: string, _projectId: string): Pr
clearTimeout(timeoutId);
if (response.status === 403) {
// 403 = account lacks Gemini Code Assist access (not same as quota exhausted)
// Keep success=false with isForbidden flag for UI to show distinct "403" badge
return {
success: false,
models: [],
lastUpdated: Date.now(),
isForbidden: true,
error: 'Quota access forbidden for this account',
error: '403 Forbidden - No Gemini Code Assist access',
};
}
+2
View File
@@ -45,6 +45,8 @@ export interface CodexQuotaResult {
accountId?: string;
/** True if token is expired and needs re-authentication */
needsReauth?: boolean;
/** True if account lacks quota access (403) - displayed as 0% instead of error */
isForbidden?: boolean;
}
/**
+2
View File
@@ -180,6 +180,8 @@ export interface CodexQuotaResult {
needsReauth?: boolean;
/** True if result was served from cache */
cached?: boolean;
/** True if account lacks quota access (403) - displayed as 0% instead of error */
isForbidden?: boolean;
}
/** Gemini CLI bucket (grouped by model series) */