Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions open-sse/executors/zed-hosted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export class ZedHostedExecutor extends BaseExecutor {
thread_id: bodyRecord.thread_id || (credentials as Record<string, unknown>)?._clientSessionId,
prompt_id: bodyRecord.prompt_id,
provider,
model,
model: bareModel,
provider_request: providerRequest,
};

Expand Down Expand Up @@ -496,7 +496,7 @@ export class ZedHostedExecutor extends BaseExecutor {
const suppressThinkClose = resolveZedSuppressThinkClose(clientHeaders, clientResponseFormat);

const wrapped = response.ok
? wrapZedCompletionStream(response, provider, model, { suppressThinkClose })
? wrapZedCompletionStream(response, provider, bareModel, { suppressThinkClose })
: response;
return {
response: wrapped,
Expand Down
18 changes: 18 additions & 0 deletions src/shared/utils/classify429.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,17 @@ const QUOTA_PATTERNS: ReadonlyArray<RegExp> = [
/organization TPD rate limit/i,
/\bTPD rate limit\b/i,
/insufficient balance/i,

// #13194 — CJK providers (z.ai/GLM, Kimi, Qwen, MiniMax) return Chinese
// quota-exhaustion messages that none of the English patterns above match.
// Without these, the gateway misclassifies them as transient rate_limit
// and retries a dead model every 60s instead of failing over.
/使用上限/,
/额度已用尽/,
/额度已用完/,
/调用上限/,
/已达上限/,
/余额不足/,
];

/**
Expand Down Expand Up @@ -166,6 +177,13 @@ const TERMINAL_QUOTA_PATTERNS: ReadonlyArray<RegExp> = [
/organization TPD rate limit/i,
/\bTPD rate limit\b/i,
/insufficient balance/i,
// #13194 — CJK equivalents for terminal quota signals.
/使用上限/,
/额度已用尽/,
/额度已用完/,
/调用上限/,
/已达上限/,
/余额不足/,
];

/**
Expand Down
Loading