Broaden unsupported-image-input recovery beyond OpenRouter 404s (OpenAI/Anthropic reject with 400)
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
Follow-up from https://github.com/block/buzz/pull/4896#discussion_r3721468349.
#4896 recovers a turn when a provider rejects image input, but the classifier (`is_unsupported_image_input_error` in `crates/buzz-agent/src/llm.rs`) only matches the OpenRouter/DeepSeek rejection (`No endpoints found that support image input`) and only runs on the 404 arms of `post()` / `openrouter_post()`.
Probed against the real post path: OpenAI- and Claude-style image rejections arrive as **400s**, which are classified as `AgentError::Llm` before the matcher ever runs. So broadening the phrase list alone changes nothing for those providers; real coverage requires:
1. Hoisting the unsupported-image check above the status dispatch (with ordering tests so 401/403/429/5xx handling is unaffected).
2. Per-provider phrases matched against **captured** rejection bodies — not guessed wording. We currently have a verbatim body only for the OpenRouter/DeepSeek case (from the trial run that motivated #4896).
Blocked on: capturing a real image-rejection body from OpenAI and Anthropic (send one image request to a text-only model on each and record status + body verbatim).
Risk note for whoever picks this up: a false positive in this classifier strips images from history on a turn where images were fine — prefer narrow matchers over broad ones like `contains("not support image")`.
Contributor guide
Assessment
This issue has not been assessed yet.