mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 12:19:35 +00:00
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:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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) */
|
||||
|
||||
Reference in New Issue
Block a user