mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-03 20:13:02 +00:00
fix(cliproxy): classify Claude quota probe 429s
This commit is contained in:
1 parent
09757b418e
commit
bdcfc20c0f
2 files changed
+15
-2
No files matched your search
@@ -295,10 +295,21 @@ async function runClaudeUsageFetch(
|
||||
continue;
|
||||
}
|
||||
clearTimeout(timeoutId);
|
||||
if (response.status === 429) {
|
||||
return {
|
||||
...buildEmptyResult('Claude usage status temporarily unavailable', accountId),
|
||||
httpStatus: response.status,
|
||||
errorCode: 'usage_probe_unavailable',
|
||||
actionHint:
|
||||
'Inference may still be available. Retry the Claude quota status check later.',
|
||||
retryable: true,
|
||||
...(retryAfter ? { errorDetail: `retry-after:${retryAfter}` } : {}),
|
||||
};
|
||||
}
|
||||
return {
|
||||
...buildEmptyResult(lastError, accountId),
|
||||
httpStatus: response.status,
|
||||
retryable: response.status === 429 || response.status >= 500,
|
||||
retryable: response.status >= 500,
|
||||
...(retryAfter ? { errorDetail: `retry-after:${retryAfter}` } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,7 +34,9 @@ export function displayClaudeQuotaSection(
|
||||
const defaultMark = accountInfo?.isDefault ? color(' (default)', 'info') : '';
|
||||
|
||||
if (!quota.success) {
|
||||
console.log(` ${fail(accountLabel)}${defaultMark}`);
|
||||
const statusIcon =
|
||||
quota.errorCode === 'usage_probe_unavailable' ? warn(accountLabel) : fail(accountLabel);
|
||||
console.log(` ${statusIcon}${defaultMark}`);
|
||||
displayQuotaFailure(quota);
|
||||
console.log('');
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user