From 5927ecc39443b967370f623d18492efdd5fdfb74 Mon Sep 17 00:00:00 2001 From: yuxuan-7814 Date: Tue, 2 Jun 2026 17:26:14 +0800 Subject: [PATCH] fix(providers): add Zhipu API error code 1210 to format error patterns This fixes issue #2943 where WeChat channel image requests to Zhipu GLM-5-Turbo vision API failed with error code 1210 (parameter error) without triggering the fallback mechanism. Changes: - Added error code 1210 pattern matching to formatPatterns - This allows the fallback mechanism to recognize Zhipu API parameter errors and fall back to alternative vision models Closes #2943 --- pkg/providers/error_classifier.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/providers/error_classifier.go b/pkg/providers/error_classifier.go index 88c92a47d..caddd5895 100644 --- a/pkg/providers/error_classifier.go +++ b/pkg/providers/error_classifier.go @@ -111,6 +111,10 @@ var ( substr("tool_use_id"), substr("messages.1.content.1.tool_use.id"), substr("invalid request format"), + // Zhipu API error code 1210: parameter error (e.g., image format incompatible) + substr("error code: 1210"), + substr("error code 1210"), + substr("zhipu api error code: 1210"), } contextOverflowPatterns = []errorPattern{ rxp(`context[_ ]?length[_ ]?exceeded`),