Skip to content

reasoning_content is missing when using DeepSeek V4 Flash in thinking #29618

Closed as not planned

Description

@beeckrumi0000

Description

Summary

When using OpenCode with OpenRouter and DeepSeek V4 Flash/Pro, the agent fails with:
[DeepSeek] The 'reasoning_content' in the thinking mode must be passed back to the API.

Environment

  • OpenCode: latest
  • OpenRouter: latest
  • Model: DeepSeek V4 Flash / DeepSeek V4 Pro
  • reasoningEffort: xhigh
  • Thinking mode: enabled

Expected behavior

OpenCode should preserve and pass reasoning_content back to the API when the model requires it.

Actual behavior

The request fails because reasoning_content is missing from the payload.

Notes

This also happens with DeepSeek V4 Pro on OpenRouter, not only Flash.
I confirmed this happens with OpenCode + OpenRouter + DeepSeek V4 Flash/Pro even after updating to the latest version.

Reference

The issue seems related to reasoning field propagation in OpenCode/OpenRouter integrations.

Plugins

warp

OpenCode version

1.15.11

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Ubuntu 22.04

Terminal

Warp

Activity

  1. github-actions commented on May 27, 2026

    @github-actions
    Contributor

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

    These existing issues cover the same root cause (reasoning_content not preserved/passed back when using DeepSeek thinking mode). Consider adding a "+1" or additional context to one of those instead.

  2. 0zKillua commented on May 28, 2026

    @0zKillua
    1. is this issue specific to openrouter+deepseek combination?
    2. Why is it not fixed? what's the work around for time being?
  3. panzeyu2013 commented on May 28, 2026

    @panzeyu2013

    I think this issue is indeed specific to openrouter. I found similar errors when using New API.

  4. ButlerJoseph commented on May 28, 2026

    @ButlerJoseph

    As a workaround I set my opencode config to this #25086 (comment)

  5. vinaysb commented on May 28, 2026

    @vinaysb

    As a workaround I set my opencode config to this #25086 (comment)

    Are you also using the same provider, i.e. siliconflow? I am using the deepseek provider and wonder if its some change on the provider side

  6. bixycler commented on May 28, 2026

    @bixycler

    This is specific to OpenRouter in my case: I see OpenCode shows thinking options and returns thinking content to the API for the official DeepSeek provider as well as the DeepSeek model in OpenCode Zen, but not for DeepSeek models via OpenRouter.

    No thinking options for DeepSeek V4 Flash via OpenRouter: (Note the OpenRouter icon at the model name)
    Image

    Show thinking options for DeepSeek V4 Flash via official provider: (Note the DeepSeek icon at the model name)
    Image

  7. bixycler commented on May 28, 2026

    @bixycler

    As a workaround I set my opencode config to this #25086 (comment)

    This workaround doesn't work for me because i need to use the official provider deepseek.com.

  8. anggaaryas commented on May 28, 2026

    @anggaaryas

    up

  9. anggaaryas commented on May 28, 2026

    @anggaaryas

    i found something interesting. The problem is the Provider! After i remove provider (deepseek). Now i can use this model again, but not discounted. sad

  10. bixycler commented on May 28, 2026

    @bixycler

    The problem is the Provider!

    Only the official provider deepseek.com requires the strict protocol of reasoning_content. Other 3rd-party providers like GMICloud, Alibaba don't require that.

  11. sardukar commented on May 28, 2026

    @sardukar

    For now, I'm using the following workaround:

    "provider": {
      "openrouter": {
        "models": {
          "deepseek/deepseek-v4-pro": {
            "name": "DeepSeek V4 Pro (fix)",
    
            "provider": {
              "npm": "@ai-sdk/openai-compatible"
            },
            "interleaved": {
              "field": "reasoning_content"
            },
    
            "options": {
              "provider": {
                "only": ["deepseek"],
                "allow_fallbacks": false
              }
            }
          }
        }
      }
    }
    ...
  12. bixycler commented on May 29, 2026

    @bixycler

    For now, I'm using the following workaround:

      ...
             "provider": {
               "npm": "@ai-sdk/openai-compatible"
             },
             "interleaved": {
               "field": "reasoning_content"
             },
     ...

    This works for me! 😊 Note that "npm": "@ai-sdk/openai-compatible" is required!
    Checking OpenRouter logs, in the raw JSON request (with "Show request" checked), i can see the field reasoning_content passed back in every turn (not just tool calls).

  13. anggaaryas commented on May 29, 2026

    @anggaaryas

    For now, I'm using the following workaround:

    ...
    "provider": {
    "npm": "@ai-sdk/openai-compatible"
    },
    "interleaved": {
    "field": "reasoning_content"
    },
    ...
    This works for me! 😊 Note that "npm": "@ai-sdk/openai-compatible" is required! Checking OpenRouter logs, in the raw JSON request (with "Show request" checked), i can see the field reasoning_content passed back in every turn (not just tool calls).

    btw, can we export opencode session as json? including the subagent

  14. github-actions commented on Jul 29, 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