fix(openai-adapters): allow disabling stream_options for strict OpenAI-compatible endpoints#12992
Conversation
…I-compatible endpoints
💡 Codex Reviewcontinue/extensions/cli/src/config.ts Lines 50 to 54 in 4f24ec0 When a CLI model specifies continue/docs-site/app/[[...slug]]/page.tsx Lines 69 to 71 in 4f24ec0 For internal redirects from Line 1136 in 4f24ec0 This replaces the only core handler for ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
The OpenAI adapter always adds
stream_options: { include_usage: true }to streaming requests. Strict OpenAI-compatible endpoints (for example Databricks serving endpoints) reject unknown fields and return400 unknown field "stream_options", so Continue cannot talk to them even though the endpoint works when called directly.Fix
Adds an optional
streamOptionsboolean to the model config, mirroring the existinguseResponsesApiopt-out. Default behavior is unchanged:stream_optionsis still injected when streaming. SettingstreamOptions: falseskips it, letting strict endpoints work:The field is declared in both the openai-adapters schema and the config-yaml model schema, and gated in
modifyChatBody(body.stream && this.config.streamOptions !== false).Test
Added a test asserting
stream_options.include_usageis present by default and absent whenstreamOptions: false.openai-adapter.vitest.tspasses (5 tests).Fixes #12936.