Skip to content

Custom inference DeepSeek thinking models need reasoning_content round-trip #11587

Closed

Description

@thesammykins

Problem

Using DeepSeek thinking models through an OpenAI-compatible Custom Inference endpoint can fail on follow-up requests because reasoning_content is not being round-tripped in conversation history.

Preview-build error observed with the OpenCode endpoint:

Response stream finished unexpectedly with internal error: POST "https://opencode.ai/zen/go/v1/chat/completions": 400 Bad Request {"message":"Error from provider (DeepSeek): The `reasoning_content` in the thinking mode must be passed back to the API.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}

Local endpoint evidence

Tested against https://opencode.ai/zen/go/v1/ without including credentials in logs or this issue.

  • GET /models lists DeepSeek thinking-capable models including deepseek-v4-pro and deepseek-v4-flash.
  • Direct POST /chat/completions probes against listed DeepSeek models worked.
  • DeepSeek responses included reasoning_content in assistant messages / stream deltas.

Provider docs

DeepSeek Thinking Mode docs describe that thinking-mode tool-call turns must pass reasoning_content back to the API on the next request:

https://api-docs.deepseek.com/guides/thinking_mode

Likely scope

This looks like provider conversation/history handling in the backend/provider adapter path, not a client model-list or Custom Inference modal contract issue.

The model autofill proposal can import DeepSeek model IDs correctly, but successful multi-turn use of these models likely requires preserving and replaying reasoning_content when constructing follow-up chat-completion requests for DeepSeek-compatible providers.

Acceptance criteria

  • DeepSeek thinking-mode responses preserve reasoning_content in conversation state when required by the provider.
  • Follow-up requests for DeepSeek-compatible models include the required reasoning_content fields in prior assistant messages.
  • The fix is scoped so providers that do not support or require reasoning_content are unaffected.
  • Add regression coverage for a multi-turn DeepSeek-compatible response that includes reasoning_content followed by a request that must replay it.

Related issue

Model autofill for Custom Inference endpoints is tracked separately in #11586.

Activity

  1. warp-for-oss commented on May 23, 2026

    @warp-for-oss
    Contributor

    @thesammykins

    Here's what I found while triaging this issue:

    DeepSeek's docs confirm that thinking-mode tool-call turns must replay reasoning_content on later requests. This looks distinct from #11586's model-import work and likely needs provider-history handling rather than Custom Inference UI changes.

    Maintainer details

    I concluded that custom Inference follow-up requests to DeepSeek thinking models appear to fail because provider-specific reasoning_content is not preserved and replayed in chat history..

    Triage summary

    This appears to be a provider-adapter bug for OpenAI-compatible Custom Inference models that expose DeepSeek thinking-mode responses. The report includes an exact 400 from the OpenCode endpoint showing DeepSeek rejected a follow-up request because reasoning_content from prior assistant/tool-call history was not replayed.

    Evidence

    • DeepSeek's thinking-mode docs state that tool-call turns must pass the assistant message's reasoning_content back on subsequent requests.
    • The current client-side custom model path sends endpoint/model metadata through custom_model_providers and has generic reasoning display support, but this checkout has no reasoning_content field or DeepSeek-specific round-trip handling.
    • That makes the most likely failing layer the server/provider adapter that reconstructs OpenAI-compatible chat-completion history for custom endpoints, rather than the Custom Inference modal/model-list UI.

    Reproducibility

    Medium. The report has a concrete endpoint, model family, provider error, and documentation backing; it still depends on a configured Custom Inference endpoint and a follow-up conversation shape that triggers DeepSeek thinking-mode tool-call history.

    Duplicate check

    I searched all open issues and recently closed issues. #11586 and #11514 are related to model discovery/import for Custom Inference endpoints, but they do not cover the reasoning_content round-trip failure, and fewer than two likely duplicates were found.

    This is my automated analysis and may be incorrect. A maintainer will verify the details.

    Powered by Oz

  2. added
    area:agent
    bug
    repro:medium
    triaged
    on May 23, 2026
  3. RajeevRKC commented on May 24, 2026

    @RajeevRKC

    Confirming this is blocking multi-turn DeepSeek conversations with Thinking Mode. The
    easoning_content field must be preserved in conversation history for subsequent API requests to work. This is a documented requirement in the DeepSeek Thinking Mode API docs.

  4. DennisZhangOiler commented on May 25, 2026

    @DennisZhangOiler

    I met same issue and I wanna fix it, but I am not familiar with the repo, can anyone guide me to the place where I should begin?

  5. Aleda commented on May 29, 2026

    @Aleda

    This might be an issue with the warp backend that can only be fixed by the warp's developers?

  6. danielpeng2 commented on Jul 30, 2026

    @danielpeng2
    Member

    Sorry for the delayed response. This was a server-side issue that we've fixed on our end. I'm going to close out this issue, but feel free to reopen if it starts again.

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

Metadata

Metadata

Assignees

Labels

area:agentbugrepro:mediumtriagedwarp:auto-triage-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions