Skip to content

OpenAI provider injects stream_options causing HTTP 400 on Databricks OpenAI-compatible serving endpoints #12936

Description

@distephan

Before submitting your bug report

Relevant environment info

- OS: Windows 11
- Continue version: v2.0.0
- IDE version: VS Code 1.127.0
- Provider: OpenAI
- Backend: Databricks OpenAI-compatible Serving Endpoint
- config:
  : Main Config
version: 1.0.0
schema: v1

models:
  - name: Databricks
    provider: openai
    model: <serving-endpoint-name>
    apiBase: https://<workspace>/serving-endpoints
    apiKey: <token>
    useResponsesApi: false

Description

Description

Continue cannot communicate with a Databricks OpenAI-compatible Serving Endpoint because the request appears to contain the unsupported field stream_options.

The endpoint works correctly when called directly via REST API (PowerShell), returning a valid OpenAI-compatible chat completion.

However, requests originating from Continue fail with:

400 Bad request: json: unknown field "stream_options"

Based on debugging, the issue appears to be caused by Continue's OpenAI adapter automatically sending:

{
  "stream_options": {
    "include_usage": true
  }
}

Databricks strictly validates request schemas and rejects unknown fields.

Additional debugging

I attempted:

useResponsesApi: false

but the behavior did not change.

I also attempted configurations intended to disable streaming. However, the logs still show:

streamEnabled:true

and Continue continues to make streaming requests.

I found a similar issue in another OpenAI-compatible client where stream_options was automatically injected into requests sent to Databricks AI Gateway and caused the same HTTP 400 error.

Possible root cause

It appears that Continue's OpenAI adapter always performs streaming requests and automatically injects:

"stream_options": {
  "include_usage": true
}

Some OpenAI-compatible backends (including Databricks Serving Endpoints) reject this field and return HTTP 400.

Would it be possible to:

  1. Stop sending stream_options for generic OpenAI-compatible providers,
  2. Add a configuration option to disable stream_options,
  3. Or allow streaming to be fully disabled for providers that do not support this parameter?

To reproduce

  1. Configure an OpenAI-compatible Databricks Serving Endpoint.
  2. Verify the endpoint works using a direct REST call.
  3. Configure Continue with:
provider: openai
apiBase: https://<workspace>/serving-endpoints
model: <serving-endpoint-name>
  1. Open Continue Chat.
  2. Send a simple prompt such as:
hello

Expected behavior

Continue should successfully call the OpenAI-compatible endpoint and display the model response.

Actual behavior

Continue returns:

400 Bad request: json: unknown field "stream_options"

and no response is displayed.

Validation already performed

The same endpoint works successfully outside of Continue.

Example PowerShell test:

Invoke-RestMethod `
  -Uri "https://<workspace>/serving-endpoints/chat/completions" `
  -Method POST `
  -Headers @{
    Authorization="Bearer <redacted>"
    "Content-Type"="application/json"
  } `
  -Body $body

Result:

object : chat.completion
choices: ...

This confirms:

  • Authentication is working
  • Endpoint is reachable
  • Model configuration is valid
  • OpenAI-compatible API is functioning correctly

The failure only occurs when requests originate from Continue.

Log output

## Relevant logs

Continue log:


[@continuedev] error: 400 Bad request: json: unknown field "stream_options"

{
  "context":"llm_stream_chat",
  "model":"<serving-endpoint-name>",
  "provider":"openai",
  "useOpenAIAdapter":true,
  "streamEnabled":true,
  "templateMessages":false
}


Stack trace:


Error: 400 Bad request: json: unknown field "stream_options"

at OpenAIApi.chatCompletionStream(...)
at OpenAI2.openAIAdapterStream(...)
at OpenAI2.streamChat(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:integrationIntegrations (context providers, model providers, etc.)ide:vscodeRelates specifically to VS Code extensionkind:bugIndicates an unexpected problem or unintended behavioros:windowsHappening specifically on Windows

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions