fix(execution): guess at Vercel AI Gateway's image rejection

This commit is contained in:
Ian 2026-10-07 16:54:31 -04:00
parent 8b0ab9ddb2
commit 887ec1727f
2 changed files with 3 additions and 1 deletions

View file

@ -66,7 +66,8 @@ _IMAGE_REJECTION = re.compile(
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"|unknown variant `image_url`", # DeepSeek, e.g. via Vercel AI Gateway
r"|unknown variant `image_url`" # DeepSeek, e.g. via Vercel AI Gateway
r"|'[^']*image[^']*' functionality not supported", # Vercel AI Gateway (AI SDK), unverified
re.IGNORECASE,
)
_MAX_COMPACTIONS_PER_CYCLE = 2

View file

@ -189,6 +189,7 @@ async def test_run_cycle_does_not_retry_permanent_error(
(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, "'Image URLs in user messages' functionality not supported.", True),
(
400,
"OpenRouterException: Message: This model's maximum context length is 1048576 "