Skip to content

An error occurred when using the deepseek-v4-pro model #24111

Closed

Description

@zghbyslzf

Description

Under the Windows system, OpenCode uses the DeepSeek-v4-Pro model, but encounters errors during the conversation process. The thinking mode of DeepSeek V4 requires that the reasoning_content returned by the previous round of the model must be passed back unchanged during multiple rounds of conversation. However, OpenCode may not currently handle this field correctly, resulting in API errors

Plugins

no

OpenCode version

v1.14.22

Steps to reproduce

Add the deepseek-v4-pro model to the local opencode.json, set it as the default model, and then initiate a complex encoding task

Screenshot and/or share link

Image

Operating System

windows 11

Terminal

PowerShell

Activity

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

    @github-actions
    Contributor

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

    These issues describe the same underlying problem you're encountering. Please check if one of them covers your case before continuing here.

  3. zghbyslzf commented on Apr 24, 2026

    @zghbyslzf
    Author

    {
    "$schema": "https://opencode.ai/config.json",
    "provider": {
    "deepseek": {
    "npm": "@ai-sdk/openai-compatible",
    "name": "DeepSeek",
    "options": {
    "baseURL": "https://api.deepseek.com",
    "apiKey": ""
    },
    "models": {
    "deepseek-v4-pro": {
    "name": "DeepSeek-V4-Pro",
    "limit": {
    "context": 1048576,
    "output": 262144
    },
    "options": {
    "reasoningEffort": "max",
    "thinking": {
    "type": "enabled"
    }
    }
    },
    // 可选Flash版本
    "deepseek-v4-flash": {
    "name": "DeepSeek-V4-Flash",
    "limit": {
    "context": 1048576,
    "output": 262144
    }
    }
    }
    }
    },
    "model": "deepseek/deepseek-v4-pro"
    }

    My local settings are as follows, and I have also looked into other related issues, but it seems that they have not resolved the problem

  4. bilbillm commented on Apr 24, 2026

    @bilbillm

    Same issue here with deepseek-v4-flash + thinking mode. The error is identical —
    easoning_content not being passed back on conversation continuation.

    There's already a working fix from the author of #24104. See fkyah3's comment at #24104 (comment) — they have a commit on their fork ( kyah3/opencode-fkyah3, branch ix/permission-reasoning-truncation, commit 5b6ad05d) that:

    1. Broadens the reasoning content check to fire for any model with capabilities.reasoning
    2. Unconditionally injects
      easoning_content (empty string if no reasoning text) into ALL assistant messages
    3. Works stably across long conversations with heavy tool use

    In the meantime, a quick workaround is to remove hinking: { type: "enabled" } from your model config — the error goes away but you lose thinking mode.

  5. zghbyslzf commented on Apr 24, 2026

    @zghbyslzf
    Author

    Same issue here with deepseek-v4-flash + thinking mode. The error is identical — easoning_content not being passed back on conversation continuation.

    There's already a working fix from the author of #24104. See fkyah3's comment at #24104 (comment) — they have a commit on their fork ( kyah3/opencode-fkyah3, branch ix/permission-reasoning-truncation, commit 5b6ad05d) that:

    1. Broadens the reasoning content check to fire for any model with capabilities.reasoning
    2. Unconditionally injects
      easoning_content (empty string if no reasoning text) into ALL assistant messages
    3. Works stably across long conversations with heavy tool use

    In the meantime, a quick workaround is to remove hinking: { type: "enabled" } from your model config — the error goes away but you lose thinking mode.

    I've checked, and it seems like fkyah3 has already fixed this issue in his forked branch. When will the current project be fixed? I don't really want to download fkyah3's code and package it locally

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

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions