You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inference parser: Decode a zstd request body for Anthropic and Chat Completions #1705
inference.ParseRequest decodes a zstd request body only for the Responses API. The Anthropic Messages and Chat Completions parsers get the raw bytes. For a zstd body on those endpoints, json.Unmarshal fails and ParseRequest returns nil. The request then has no inference classification and no request telemetry. The gateway cost header still prices the response.
No listener decompresses a request body before the plugins see it (see the parsercommon.DecodeRequestBody doc comment).
Impact today
None known. Codex is the only client that we saw send zstd, and it sends zstd to the Responses endpoint only. The defect is latent. It becomes live when a client sends a compressed body to /v1/messages or /v1/chat/completions.
Fix decision
Call parsercommon.DecodeRequestBody(headers, body) once in ParseRequest, before the dialect switch. Remove the call from parseResponsesRequest. Add a zstd test case for each dialect.
The base code had the same behaviour. CodeRabbit found it on #1703. That PR is a pure move, so the fix is not in it.
Activity
Fix: Decode a zstd request body for every inference dialect