Skip to content

fix(opencode): make the OSS provider usable at all - #420

Open
larsmoan wants to merge 2 commits into
databricks:mainfrom
larsmoan:fix/opencode-oss-provider-rejections
Open

fix(opencode): make the OSS provider usable at all#420
larsmoan wants to merge 2 commits into
databricks:mainfrom
larsmoan:fix/opencode-oss-provider-rejections

Conversation

@larsmoan

@larsmoan larsmoan commented Aug 31, 2026

Copy link
Copy Markdown

Every model in the databricks-oss bucket fails on its first request. Two fields
in the request body reach the gateway's strict validator, and each one earns an
HTTP 400. This is not qwen-specific, and it needs no MCP server to reproduce.

Bad request: json: unknown field "prompt_cache_key"
max_tokens (32000) cannot exceed 25000.

prompt_cache_key. OpenCode stamps this field on every @ai-sdk/openai
request. OpenCode reads the setCacheKey opt-out from the provider options
only. I tested a per-model entry against a live gateway, and it does not suppress
the field.

The output cap. _MODEL_TOKEN_LIMITS knew one family, glm. Every other
model sent OpenCode's 32000 default. The gateway caps output per model: 25000 for
qwen35-122b-a10b, gpt-oss-120b and gpt-oss-20b, and 8192 for
llama-4-maverick and gemma-3-12b. The cap is not discoverable, because the
model-services listing and the serving-endpoints API both omit it. So the table
grows. The Maverick key is the full llama-4-maverick, because a bare llama key
would pin a 1M context on the 128k Llama 3 endpoints.

Verification

All five OSS models on the test workspace answer. Before this change all five
returned HTTP 400. Each fix alone still fails, so both are needed.

Every model in the `databricks-oss` bucket failed on its first request. Two
separate fields in the request body reached the gateway's strict validator and
each one earned an HTTP 400.
Copilot AI lite review requested due to automatic review settings August 31, 2026 08:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings August 31, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants