fix: restore coding history and quota feedback
This commit is contained in:
@@ -3,8 +3,10 @@ export type AIGatewayErrorKind = 'quota_exhausted' | 'authentication_invalid';
|
||||
export function isTokenBalanceExhausted(message: string | null | undefined): boolean {
|
||||
const normalized = message?.trim().toLowerCase() ?? '';
|
||||
return normalized.includes('token_balance_exhausted')
|
||||
|| normalized.includes('token_point_balance_exhausted')
|
||||
|| normalized.includes('token balance exhausted')
|
||||
|| normalized.includes('balance exhausted');
|
||||
|| normalized.includes('balance exhausted')
|
||||
|| normalized.includes('词元点数余额不足');
|
||||
}
|
||||
|
||||
export function getAIGatewayErrorKind(message: string | null | undefined): AIGatewayErrorKind | null {
|
||||
|
||||
@@ -28,6 +28,7 @@ export type CodingRuntimeErrorCode =
|
||||
| 'CODING_RUNTIME_READY_TIMEOUT'
|
||||
| 'CODING_RUNTIME_PROTOCOL_ERROR'
|
||||
| 'CODING_PROVIDER_AUTH_REQUIRED'
|
||||
| 'CODING_PROVIDER_QUOTA_EXHAUSTED'
|
||||
| 'CODING_MODEL_UNAVAILABLE'
|
||||
| 'CODING_SESSION_UNREADABLE'
|
||||
| 'CODING_STORAGE_WRITE_FAILED'
|
||||
|
||||
@@ -60,6 +60,7 @@ const ERROR_CODES = new Set([
|
||||
'CODING_RUNTIME_READY_TIMEOUT',
|
||||
'CODING_RUNTIME_PROTOCOL_ERROR',
|
||||
'CODING_PROVIDER_AUTH_REQUIRED',
|
||||
'CODING_PROVIDER_QUOTA_EXHAUSTED',
|
||||
'CODING_MODEL_UNAVAILABLE',
|
||||
'CODING_SESSION_UNREADABLE',
|
||||
'CODING_STORAGE_WRITE_FAILED',
|
||||
|
||||
Reference in New Issue
Block a user