fix(execution): match DeepSeek's image rejection

This commit is contained in:
Ian 2026-10-07 16:48:45 -04:00
parent 9c44bba118
commit 8b0ab9ddb2
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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 "