continuedev / continuedev/continue

[Bug] CLI: 400 reasoning_content error when using @file (Tool Calls) with DeepSeek API, regardless of thinking mode

Open
#12,246 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:tools kind:bug os:windows
Dominant language
TypeScript
Stars
36k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Before submitting your bug report
Relevant environment info
- OS: Windows
- Continue version: CLI (Latest)
- IDE version: N/A (Using `cn` CLI directly)
- Model: DeepSeek-V4-Flash / DeepSeek-V4-Pro
- config:
  
  models:
    - name: DeepSeek-V4-Flash
      provider: deepseek
      model: deepseek-v4-flash
      apiKey: "sk-xxx"  # Masked
      apiBase: "[https://api.deepseek.com](https://api.deepseek.com)"
      completionOptions:
        maxTokens: 8192
      requestOptions:
        extraBody:
          thinking: 
            type: "disabled"
Description

Describe the bug
When using the Continue CLI (cn) with the DeepSeek API, referencing a file via @filename triggers MCP tool calls (e.g., Read, List). After the CLI successfully executes the tool locally, it attempts to send the tool output back to the API. During this context rebuilding phase for the tool-response loop, the CLI seems to strip or improperly format the message history.

This causes DeepSeek's strict API gateway to reject the request with a 400 error, complaining about missing reasoning_content in the assistant's previous message.

Crucial Note: This bug is triggered purely by the tool-call context loop. It happens even if using non-reasoning models (deepseek-v4-flash) or explicitly setting thinking: type: "disabled" in config.yaml.

To Reproduce
Steps to reproduce the behavior:

Ensure you are on the latest version of Continue CLI.

Configure a DeepSeek model in config.yaml as shown above.

Start a clean CLI session.

Input a prompt referencing a local file: @src/my_test_crew/crew.py please review this code.

Observe the CLI successfully invoking tools:
● Read(src/my_test_crew/crew.py)
⎿ Read tool output (198 lines)

Immediately after, the CLI throws the following error:
Error: 400 The reasoning_content in the thinking mode must be passed back to the API.

Expected behavior
When handling multi-turn conversations involving tool_calls and tool_responses, the CLI should retain the necessary message structure (e.g., appending an empty reasoning_content: "" string if required by the provider) to satisfy DeepSeek's API validation.

Temporary Workaround for Other Users
For those currently blocked by this, you can bypass the agentic tool-call loop by starting the CLI with tools disabled:
cn --exclude *
This forces the CLI to read the file locally and append it as raw text into the prompt, avoiding the tool-return loop and successfully bypassing the 400 error.

To reproduce

No response

Log output

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the CLI tool-call and tool-response context-rebuilding flow described in the report, using the DeepSeek setup in config.yaml and reproducing with @src/my_test_crew/crew.py. Trace the request sent after the local Read tool completes, then verify that the tool-response loop succeeds against DeepSeek with thinking disabled and enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.