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
{{ message }}
Repository navigation
Reasoning toggle (thinking.type=enabled) not emitted for OpenAI-compatible models with a models.dev reasoning toggle (DeepSeek V4 Flash) #39933
Bug: opencode doesn't enable reasoning for OpenAI-compatible models that declare a reasoning toggle in models.dev (e.g. DeepSeek V4 Flash via Zen).
Model:opencode/deepseek-v4-flash — its models.dev entry declares reasoning_options = [{ type = "toggle" }, { type = "effort", values = ["high","max"] }] with [interleaved] field = "reasoning_content".
Expected: reasoning engages (e.g. via --variant max or options.thinking), like the Anthropic thinking option does.
Actual: reasoning never engages. --variant max/high, --thinking, options.reasoningEffort, and options.thinking = {type:"enabled"} all yield zero reasoning_content and 0 reasoning tokens; per-request cost stays flat. providerOptions passthrough of thinking returns HTTP 400.
Repro: the gateway itself honours the toggle — same key/endpoint via curl returns full reasoning_content:
curl https://opencode.ai/zen/v1/chat/completions -H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" -d '{"model":"deepseek-v4-flash","thinking":{"type":"enabled"},"reasoning_effort":"max","stream":true,"messages":[{"role":"user","content":"9.11 vs 9.8? reason step by step."}]}'
Through opencode run -m opencode/deepseek-v4-flash --thinking the stream has no reasoning parts.
For comparison, OpenAI-style models on the same gateway (e.g. opencode/gpt-5.6-luna --variant max) DO engage reasoning correctly via reasoning_effort, so the gap is specific to the toggle capability.
Likely cause: the OpenAI-compatible adapter forwards reasoning_effort but not the models.dev toggle field (thinking.type=enabled).
Activity
github-actions commentedon Jul 31, 2026
This issue might be a duplicate of existing issues. Please check:
options(reasoning/thinking) not forwarded to API for@ai-sdk/openai-compatibleproviders in headless mode #27361: Modeloptions(reasoning/thinking) not forwarded to API for@ai-sdk/openai-compatibleproviders — covers the same root cause of reasoning parameters not being sent through the OpenAI-compatible adapter, though your report is more specific to the models.devtogglecapability type vseffort-based reasoning.github-actions commentedon Sep 30, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.