Patch Changes
-
86892f3: fix(openai-compatible): preserve unmapped usage fields in
usage.rawusage.rawis specified as usage "in the shape that the provider returns",
and the chat model already parsed the usage object loosely so that extra
top-level fields survived. The nestedprompt_tokens_detailsand
completion_tokens_detailsobjects were still strict, so anything a provider
reported inside them was dropped — which is where providers put their most
distinguishing detail. The existing "should preserve extra usage fields"
fixture was itself losingaudio_tokens,image_tokensandtext_tokens
this way.Both nested objects are now parsed loosely, as is the completion model's usage
schema, which was strict throughout despite feeding the samerawfield.Only
usage.rawchanges. The mapped token counts are unaffected.