Skip to content

[Bug] DeepSeek V4 Flash Responses multi-tool continuation fails with reasoning_text 400 on 2.12.0 #1534

Description

@Hzzz7

Client or integration

Codex App

Provider or upstream service

Official DeepSeek API (https://api.deepseek.com)

OpenCodex version

2.12.0

Endpoint or capability

DeepSeek native Responses route (/responses), thinking/reasoning metadata replay, and multi-tool continuation for deepseek/deepseek-v4-flash.

Current behaviour

DeepSeek V4 Flash routed through the native Responses adapter completes plain-text turns and a simple single-tool continuation, but a controlled multi-tool continuation fails with:

The `reasoning_text` in the thinking mode must be passed back to the API.

The upstream failure is exposed to Codex App as HTTP 400, so the turn fails immediately without retrying.

The same controlled task completes successfully with DeepSeek V4 Pro.

Controlled comparison, all read-only with thinking effort high:

Task shape V4 Flash V4 Pro
Plain-text response, no tools Success Success
Read one file using one tool, then answer Success Success
Read a local health endpoint and one file, then synthesize the result HTTP 400 reasoning_text, turn failed Success

Flash failure sequence in one conversation:

  1. Initial request: HTTP 200
  2. Tool continuation request: HTTP 200
  3. Later continuation request: HTTP 400 in 137 ms

Redacted request IDs:

  • ocx-msq223nj-7e: HTTP 200
  • ocx-msq227gx-7p: HTTP 200
  • ocx-msq229y1-7q: HTTP 400, 137 ms

Pro control for the same multi-tool task:

  • ocx-msq225tn-7l: HTTP 200
  • ocx-msq22c1t-7r: HTTP 200
  • Final answer completed

Expected behaviour

Every reasoning item returned before tool calls should be preserved and replayed in the subsequent stateless DeepSeek Responses request. This must continue to hold for later continuations involving multiple tool calls/results.

The multi-tool Flash turn should complete in the same way as the plain-text, single-tool, and Pro controls.

Minimal redacted request or reproduction

# Environment:
# - Windows
# - Codex App
# - OpenCodeX 2.12.0
# - official DeepSeek provider
# - model: deepseek/deepseek-v4-flash
# - thinking effort: high
# - no explicit providers.deepseek.modelAdapters override

# In a new Codex App task, ask Flash to:
# 1. Read the local OpenCodeX health endpoint using a read-only tool:
#    http://127.0.0.1:10100/healthz
# 2. Read the first line of an existing local text file using another read-only tool.
# 3. Synthesize both results in the final answer.

# Controls:
# A. Plain-text answer without tools: succeeds.
# B. Read one file with one tool, then answer: succeeds.
# C. The multi-tool sequence above: later continuation fails with HTTP 400.
# D. Repeat C using deepseek/deepseek-v4-pro: succeeds.

Actual response or error

HTTP 400

{
  "error": {
    "message": "The `reasoning_text` in the thinking mode must be passed back to the API.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_request_error"
  }
}

The Codex turn is marked failed and no automatic retry occurs.

Upstream documentation

The expected behaviour is also a concrete client/provider requirement: DeepSeek rejects a thinking-mode continuation when prior reasoning is not passed back.

Suggested mapping or implementation notes

Please preserve and replay the complete plaintext reasoning item for DeepSeek's stateless Responses continuation, including later continuations after multiple tool results.

OpenCodeX 2.11.1 and 2.12.0 both contain the Flash Responses registry default, so this is not caused by 2.12.0 introducing the route. OpenCodeX 2.12.0 also includes requiresAdjacentResponsesToolResults for DeepSeek, but this controlled reproduction still fails.

The persisted provider configuration uses openai-chat as its provider adapter and has no explicit modelAdapters override; Flash uses the registry default openai-responses route for Responses inbound.

Additional context and attachments

This appears related to, but is not identical to, #875:

Related upstream/client issue:

No secrets, raw request bodies, complete logs, configuration files, account details, or credentials are attached.

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions