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
Describe the feature or problem you'd like to solve
some llm providers might require additional nonstandard request parameters for certain features or tweaks
Proposed solution
env var COPILOT_EXTRA_REQUEST_PARAMS='{"abc": "def"}'
so {"abc": "def"} will be appended to the llm request body
similar features seems also exist in various other agent frameworks
For providers that require this opt-in, omitting stream_options.include_usage means the response stream does not contain token usage. That prevents clients from obtaining actual input/output token counts from that response and makes usage monitoring harder. Custom HTTP headers would not solve this, because the option belongs in the JSON request body.
There is also evidence that some CLI paths already include it:
Those are other users' captures, not a reproduction of a missing-field bug. They suggest the first step should be to establish whether inclusion is already intended across all streaming Chat Completions BYOK paths, and whether omissions depend on version, provider configuration, or request type.
For implementation, I would suggest separating two concerns:
Consistent usage reporting: Include stream_options.include_usage: true by default for streaming Chat Completions requests where supported. Make sure the streaming parser accepts a final usage-only chunk with an empty choices array, retains its usage, and exposes the counts through the existing usage reporting/events.
Provider-specific request options: Add a documented way to merge extra JSON body parameters per provider, with clear precedence and nested-object merge behavior. For example, the environment variable proposed in this issue could express:
# Proposed syntax; not an existing supported setting.export COPILOT_EXTRA_REQUEST_PARAMS='{"stream_options":{"include_usage":true}}'
A documented provider-level override would also help with endpoints that reject this option. It should not be injected indiscriminately into Responses or Anthropic Messages requests: related proxy bugs show that doing so can cause HTTP 400 errors (github/gh-aw-firewall#3804, github/gh-aw-firewall#7201).
Useful regression coverage would include OpenAI-compatible and Azure Chat Completions requests, preservation of other stream_options fields, propagation of usage from the final SSE chunk, and exclusion of this Chat Completions option from the other wire protocols.
Is the automatic inclusion shown in those captures the intended behavior for all streaming Chat Completions BYOK requests? If so, documenting that guarantee and providing a provider-specific override would help distinguish a regression from a configuration limitation.
Activity
ZzetT commentedon May 21, 2026
Is this similar to what I described in #3399?
lictex commentedon May 21, 2026
y quite similar but this is for request body instead of headers
doggy8088 commentedon Oct 21, 2026
A concrete use case for this feature is requesting token usage from a streaming OpenAI-compatible BYOK endpoint:
{ "stream": true, "stream_options": { "include_usage": true } }For providers that require this opt-in, omitting
stream_options.include_usagemeans the response stream does not contain token usage. That prevents clients from obtaining actual input/output token counts from that response and makes usage monitoring harder. Custom HTTP headers would not solve this, because the option belongs in the JSON request body.There is also evidence that some CLI paths already include it:
COPILOT_PROVIDER_TYPE=openaiandCOPILOT_PROVIDER_WIRE_API=completions, includingstream_options: {"include_usage": true}.Those are other users' captures, not a reproduction of a missing-field bug. They suggest the first step should be to establish whether inclusion is already intended across all streaming Chat Completions BYOK paths, and whether omissions depend on version, provider configuration, or request type.
For implementation, I would suggest separating two concerns:
Consistent usage reporting: Include
stream_options.include_usage: trueby default for streaming Chat Completions requests where supported. Make sure the streaming parser accepts a final usage-only chunk with an emptychoicesarray, retains its usage, and exposes the counts through the existing usage reporting/events.Provider-specific request options: Add a documented way to merge extra JSON body parameters per provider, with clear precedence and nested-object merge behavior. For example, the environment variable proposed in this issue could express:
A documented provider-level override would also help with endpoints that reject this option. It should not be injected indiscriminately into Responses or Anthropic Messages requests: related proxy bugs show that doing so can cause HTTP 400 errors (github/gh-aw-firewall#3804, github/gh-aw-firewall#7201).
Useful regression coverage would include OpenAI-compatible and Azure Chat Completions requests, preservation of other
stream_optionsfields, propagation of usage from the final SSE chunk, and exclusion of this Chat Completions option from the other wire protocols.Is the automatic inclusion shown in those captures the intended behavior for all streaming Chat Completions BYOK requests? If so, documenting that guarantee and providing a provider-specific override would help distinguish a regression from a configuration limitation.