fix: restore coding history and quota feedback

This commit is contained in:
inman committed 2026-09-01 11:46:04 +08:00
1 parent 38f85f6b5e
commit d523b72cf8
14 files changed
+480 -49

No files matched your search

+3 -1
View File
@@ -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 {