Skip to content

Reasoning toggle (thinking.type=enabled) not emitted for OpenAI-compatible models with a models.dev reasoning toggle (DeepSeek V4 Flash) #39933

Closed as not planned

Description

@bowber

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).

Env: opencode 1.18.5, Linux.

Activity

  1. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions