Skip to content

OpenRouter JSON 404 payloads do not trigger model fallback #51571

@mrdear

Description

@mrdear

Problem

OpenRouter sometimes returns HTTP 404 with a JSON body like:

{"error":{"message":"Healer Alpha was a stealth model revealed on March 18th as an early testing version of MiMo-V2-Omni. Find it here: https://openrouter.ai/xiaomi/mimo-v2-omni","code":404},"user_id":"user_33GTyP8uDSYYbaeBO48AGHXyuMC"}

Even though this means the requested model is unavailable, fallback selection did not treat it as model_not_found.

Repro

  1. Call OpenRouter with model: "openrouter/healer-alpha".
  2. Receive the JSON 404 payload above.
  3. Observe that model fallback stays on the failing candidate instead of continuing to the fallback chain.

Expected

A JSON-wrapped 404 model error should trigger model fallback the same way a plain model not found error does.

Actual

The fallback classifier missed the error because it only recognized 404 when paired with not found text, and OpenRouter's payload uses a different message.

Evidence

  • Repro via curl -v against https://openrouter.ai/api/v1/chat/completions
  • Local regression tests added for the JSON 404 payload

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions