From 1722cfc28222f5259a717a52aaeb63b0a44c1a5c Mon Sep 17 00:00:00 2001 From: LiusCraft Date: Thu, 30 Apr 2026 02:24:29 +0800 Subject: [PATCH] feat: add DeepSeek vision unsupported error detection Add detection for 'unknown variant' + 'image_url' error pattern used by DeepSeek and other strict providers when vision is not supported. These providers reject the image_url field at the JSON schema level rather than returning a semantic 'not supported' message. --- pkg/agent/llm_media.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/agent/llm_media.go b/pkg/agent/llm_media.go index eb1908777..31692174b 100644 --- a/pkg/agent/llm_media.go +++ b/pkg/agent/llm_media.go @@ -56,5 +56,12 @@ func isVisionUnsupportedError(err error) bool { return true } + // DeepSeek and other strict providers reject the image_url field at the + // JSON schema level with an "unknown variant" error rather than a semantic + // "not supported" message. + if strings.Contains(msg, "unknown variant") && strings.Contains(msg, "image_url") { + return true + } + return false }