Skip to content

Broaden unsupported-image-input recovery beyond OpenRouter 404s (OpenAI/Anthropic reject with 400) #4899

Description

@tlongwell-block

Follow-up from #4896 (comment).

#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 fix(agent): recover from unsupported image input instead of poisoning the turn #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").

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions