fix(llm): request stream usage by default with extra_body override (#822)
* fix(llm): request stream usage by default with extra_body override Streaming requests currently receive token usage only when the provider volunteers it: OpenAI-compatible servers omit usage from streams unless stream_options.include_usage is set, so streamed reviews silently lose token and cost accounting. Set stream_options.include_usage=true by default when streaming. The existing extra_body passthrough stays in control: an explicit stream_options object replaces the default, an explicit null suppresses the field entirely for gateways that reject stream_options, and non-streaming requests never carry the field (mirroring the #647 treatment of the "stream" key). * fix(llm): keep include_usage on when stream_options configures unrelated options An explicit stream_options object in extra_body used to replace the include_usage default wholesale, so configuring an unrelated stream option silently disabled usage accounting. include_usage now stays requested unless the config spells it out (or suppresses stream_options with an explicit null).
F
Fanzzzd committed
8a300f835a5e469e6479224859ad7276d760ca1e
Parent: b3cc894
Committed by GitHub <noreply@github.com>
on 9/10/2026, 7:44:44 AM