Skip to content

DeepSeek V4 Pro (OpenRouter) reasoning_content error - v1.14.27 #24569

Closed

Description

@077dwei

Description

[DeepSeek] The reasoning_content in the thinking mode must be passed back to the API.

OpenCode version

v1.14.27 (latest)

Plugins

No response

OpenCode version

V1.14.27

Steps to reproduce

No response

Screenshot and/or share link

Image

Operating System

Debian GNU/Linux 13 (trixie) (6.12.74+deb13+1-amd64)

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 27, 2026
  2. github-actions commented on Apr 27, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of several existing issues reporting the same reasoning_content error with DeepSeek thinking mode. Please check:

    If your issue is the same, please consider adding a reaction or comment to one of the above instead of opening a new report.

  3. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    @077dwei please please provide a session demonstrating it:

    opencode export > session.json

    RUN THIS IN YOUR TERMINAL DO NOT USE /export

    And then send me the session dump.

  4. Meepoljdx commented on Apr 27, 2026

    @Meepoljdx

    same issue @rekram1-node this is my session json

    session.json

  5. 077dwei commented on Apr 27, 2026

    @077dwei
    Author

    @rekram1-node

    session.json

    Trimmed session (only error-related part):

  6. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    @Meepoljdx you are using something called:
    "providerID": "deepseek-plat",

    I need to see your provider config it's prolly missing interleaved settings

  7. broaz27 commented on Apr 27, 2026

    @broaz27

    I can't reproduce the issue anymore, but only in new sessions, im on deepseekv4 pro, provided by deepseek on openrouter, my interleaved settings are on their default "reasoning_content"

  8. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    @077dwei I can't have a trimmed session, I need your actual session otherwise it provides basically 0 value. If you need it secret use --sanitize

    The session you sent has 0 assistant messages so the error would be impossible

  9. 077dwei commented on Apr 27, 2026

    @077dwei
    Author

    @rekram1-node Sorry for sending the trimmed version earlier. Here is the full session exported with --sanitize:

    session_sanitized.json

  10. ngkhanhlinh2k4 commented on Apr 27, 2026

    @ngkhanhlinh2k4

    me too, still error like that

  11. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    @ngkhanhlinh2k4 more info plz

  12. yujf commented on Apr 27, 2026

    @yujf

    session.json
    If a shell command is executed even once in the middle, a 400 error will occur.
    @rekram1-node

  13. 372572571 commented on Apr 27, 2026

    @372572571

    Actually, as long as you use the OMO plugin's Plan Builder with the DeepSeek V4 model to start planning a feature, when your context usage reaches about 10%, this problem will inevitably be triggered — it feels like something has been cleared.

  14. 3 remaining items

  15. rekram1-node commented on Apr 27, 2026

    @rekram1-node
    Collaborator

    For anyone using custom providers do this:

    "provider": {
        "custom-deepseek": {
          "models": {
            "deepseek-v4-pro": {
              "interleaved": {
                "field": "reasoning_content",
              },
            },
          },
        },
      },
    

    I'll configure stuff to default it to set this for deepseek models but for now you need to follow this as mentioned in many issues and many prs (@yujf @Meepoljdx)

  16. yujf commented on Apr 28, 2026

    @yujf

    Thank you, it works fine after adding interleaved. @rekram1-node

  17. hearkenmx commented on Apr 28, 2026

    @hearkenmx

    Same issue here. Environment details:

    • opencode v1.14.28
    • Provider: @ai-sdk/openai-compatible with custom endpoint (myeth)
    • Model: deepseek-v4-pro
    • Error: AI_APICallError: The reasoning_content in the thinking mode must be passed back to the API.

    Occurs consistently on the 2nd+ turn. Workaround: setting "reasoning": false in opencode.json model config.

  18. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    @hearkenmx refer to what I said above, or provide your config

  19. jukefr commented on Apr 28, 2026

    @jukefr

    still having issues with this even after doing what you suggested with interleaved....

    {
      "$schema": "https://opencode.ai/config.json",
      "permission": {
        "*": "allow",
        "doom_loop": "ask",
        "external_directory": "ask",
        "read": {
          "*": "allow",
          "*.env": "deny",
          "*.env.*": "deny",
          "*.env.example": "allow"
        },
        "bash": {
          "*": "allow",
          "rm -rf *": "ask",
          "git push --force*": "deny",
          "git push -f *": "deny",
          "DROP TABLE*": "deny",
          "DROP DATABASE*": "deny"
        }
      },
      "mcp": {
        "context7": {
          "type": "remote",
          "url": "https://mcp.context7.com/mcp",
          "enabled": true
        },
        "engram": {
          "type": "local",
          "command": [
            "engram",
            "mcp",
            "--tools=agent"
          ]
        }
      },
      "snapshot": false,
      "autoupdate": "notify",
      "share": "manual",
      "provider": {
        "openrouter": {
          "models": {
            "deepseek/deepseek-v4-flash": {
              "interleaved": {
                "field": "reasoning_content"
              }
            }
          }
        }
      }
    }
    

    the first like 5 requests seem to go fine but then the

    [DeepSeek] The `reasoning_content` in the thinking mode must be passed back to the API.
    

    appears out of nowhere

    it happened right after a todowrite tool call if that helps ?

    and also the session appear to be unrecoverable from this point onwards no matter what prompt you pass to deepseek

    and im running latest release also 1.14.28

  20. i-blis commented on Apr 28, 2026

    @i-blis

    Issue persists even with

    "provider": {
        "openrouter": {
          "models": {
            "deepseek-v4-flash": {
              "interleaved": {
                "field": "reasoning_content",
              },
            },
          },
        },
      },
    

    Running 1.14.28, session posted above.

  21. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    Yeah it's a bug in openrouter sdk ill get to it

  22. DiegoMagdaleno commented on Apr 28, 2026

    @DiegoMagdaleno

    Having the same issue with OpenCode Go, I reproduced it on a random task.

    session.json

  23. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    @DiegoMagdaleno that's because you are on an older version, please upgrade

  24. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    Okay OpenRouter said they are merging a fix on their end

    Note to those in this thread this is an issue about OPENROUTER so if you are having issues with a specific provider check:

    • are you on latest
    • are you using openrouter? If not open a new issue or comment on separate one
    • are you using custom provider? If so be sure to set the interleaved reasoning fields
  25. rekram1-node commented on Apr 28, 2026

    @rekram1-node
    Collaborator

    Okay their change rolled out to their api, I tested and was unable to reproduce issue after, will close this but continue monitoring

  26. hearkenmx commented on Apr 29, 2026

    @hearkenmx

    new-api based router has the same issue, in case anyone use that infra, I think they already aware of it.
    QuantumNous/new-api#4408

  27. 0x7CFE commented on May 27, 2026

    @0x7CFE

    Experienced the same issue today on OpenRouter. Everything just broke. OTOH, free tier model from Zen worked flawlessly.

    Tried switching/banning specific providers using OpenRouter guardrails, got this or just 400.

    Image

    P.S.: Also usage price just exploded. Don't sure if it's related. Looked almost like queries weren't cached at all.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions