-
-
Notifications
You must be signed in to change notification settings - Fork 80.3k
Model fallback not triggered for Zhipu (GLM) error code 1305 — overloaded pattern mismatch #93211
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
No fields configured for issues without a type.
Summary
Model fallback (
agents.defaults.model.fallbacks) is not triggered when the primary Zhipu (GLM) provider returns error code[1305]with message该模型当前访问量过大,请您稍后再试(model overloaded). The agent fails immediately without trying the configured fallback model.Environment
2026.6.5glm/GLM-5.2(Zhipu AI, via Anthropic-compatible API athttps://open.bigmodel.cn/api/anthropic)["minimax/MiniMax-M3"]Reproduction
glmas primary provider andminimax/MiniMax-M3as fallback[1305][该模型当前访问量过大,请您稍后再试]minimax/MiniMax-M3LLM request failed, no fallback attemptRoot Cause Analysis
The failover error classifier (
classifyFailoverSignal→classifyFailoverClassificationFromMessage) does not recognize the Zhipu error format:1305classifyFailoverReasonFromCode(only matches English codes likeRESOURCE_EXHAUSTED,RATE_LIMIT)isRateLimitErrorMessageisOverloadedErrorMessagePROVIDER_SPECIFIC_PATTERNS[1305]or Zhipu-specific patternsSince none match,
coerceToFailoverError()returnsnull, andrunWithModelFallback()treats it as a non-failover error, throwing immediately.Suggested Fix
Two changes in
src/agents/embedded-agent-helpers/:1. Add Zhipu overloaded pattern to
PROVIDER_SPECIFIC_PATTERNS(in errors.ts)2. Add Chinese overloaded variants to
ERROR_PATTERNS.overloaded(in sanitize-user-facing-text.ts)This ensures both the code-based pattern (
[1305]) and the message-based pattern (访问量过大) are caught, classifying the error as"overloaded"which is a recognized failover reason that triggers fallback.Workaround
Patch
node_modulesdirectly (will be lost onnpm update):Additional Context
Other Chinese AI providers (e.g. DashScope/Alibaba, Baidu ERNIE) likely have similar Chinese-language error messages that may not match the current English-dominated patterns. Consider a broader audit of Chinese provider error formats.