From 8b0ab9ddb257c991ce607670b90f599e14aaaba8 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 7 Oct 2026 16:48:45 -0400 Subject: [PATCH] fix(execution): match DeepSeek's image rejection --- strix/core/execution.py | 3 ++- tests/test_execution_transient_retry.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/strix/core/execution.py b/strix/core/execution.py index a0b81490..c6af2263 100644 --- a/strix/core/execution.py +++ b/strix/core/execution.py @@ -65,7 +65,8 @@ _IMAGE_REJECTION = re.compile( r"|image_url is only supported by certain models" # OpenAI r"|is not a multimodal model|at most 0 image\(s\)" # vLLM r"|does not support image input" # LiteLLM's Fireworks check - r"|doesn't support the image field", # Bedrock Converse + r"|doesn't support the image field" # Bedrock Converse + r"|unknown variant `image_url`", # DeepSeek, e.g. via Vercel AI Gateway re.IGNORECASE, ) _MAX_COMPACTIONS_PER_CYCLE = 2 diff --git a/tests/test_execution_transient_retry.py b/tests/test_execution_transient_retry.py index fa9f13c5..f175e1e9 100644 --- a/tests/test_execution_transient_retry.py +++ b/tests/test_execution_transient_retry.py @@ -188,6 +188,7 @@ async def test_run_cycle_does_not_retry_permanent_error( (400, "Invalid content type. image_url is only supported by certain models.", True), (400, "my-model is not a multimodal model", True), (400, "This model doesn't support the image field for user messages.", True), + (422, "messages[3]: unknown variant `image_url`, expected `text`", True), ( 400, "OpenRouterException: Message: This model's maximum context length is 1048576 "