From 3ebfb1e707f1f0d4d2fda2c2f3e8f2c463782f2a Mon Sep 17 00:00:00 2001 From: Abhijay Jain Date: Tue, 22 Sep 2026 03:15:18 +0000 Subject: [PATCH] fix(providers): classify many-image dimension limit errors as context length-exceeded (#12208) --- crates/goose-providers/src/http_status.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/goose-providers/src/http_status.rs b/crates/goose-providers/src/http_status.rs index a7ec2c969..9eb441382 100644 --- a/crates/goose-providers/src/http_status.rs +++ b/crates/goose-providers/src/http_status.rs @@ -234,7 +234,11 @@ fn is_context_length_exceeded_message(text: &str) -> bool { return true; } - mentions_prompt_input_tokens && mentions_limit && mentions_overflow + if mentions_prompt_input_tokens && mentions_limit && mentions_overflow { + return true; + } + + text_lower.contains("many-image") && text_lower.contains("exceed") } pub fn map_http_error_to_provider_error( @@ -727,6 +731,7 @@ mod tests { "Request body is too large", "Request payload too large", "Content-Length exceeds the maximum allowed request size", + "At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels", ]; for message in messages {