Skip to content

Format translation forwards unknown content-block fields (message_id) to strict upstreams -> whole-request 400/422 #16384

Description

@amraly83

Environment

  • Self-hosted image: diegosouzapw/omniroute:3.8.51-web
  • Any strict OpenAI-compatible upstream (Cerebras, Mistral, Groq observed)

What happens

When a client sends user messages whose content blocks carry a non-standard field (here: message_id, emitted by a popular chat client during context compaction), OmniRoute forwards the unknown field verbatim during wire-format translation. Strict validators then reject the entire request:

  • Cerebras: 400 — property 'messages.2.user.message_id' is unsupported
  • Mistral: 422 — extra_forbidden
  • Groq: 400 — role:user constraint

Example request shape:

{
  "model": "...",
  "messages": [
    {"role": "user", "content": [
      {"type": "text", "text": "...", "message_id": "msg_01ABC"}
    ]}
  ]
}

Impact

In a priority combo, one such request cascades: every strict-validator target burns (400/422 each), latency spikes, and the request only lands on a lenient wrapper (antigravity/nvidia tolerate extra fields) — or fails entirely. We observed ~1,948 client aborts (499) in 6h from a single client doing periodic compaction.

Suggested fix

When translating between wire formats (client format → upstream OpenAI/Anthropic format), strip unknown fields from content blocks rather than forwarding them — or sanitize per upstream validator. Unknown top-level message fields like message_id are client metadata and shouldn't reach providers.

Happy to provide full gateway logs of the cascade.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions