Skip to content

fix: add reasoning content field support in chat body#10027

Merged
RomneyDa merged 1 commit intocontinuedev:mainfrom
uinstinct:deepseek-reasoningsupport
Feb 3, 2026
Merged

fix: add reasoning content field support in chat body#10027
RomneyDa merged 1 commit intocontinuedev:mainfrom
uinstinct:deepseek-reasoningsupport

Conversation

@uinstinct
Copy link
Contributor

@uinstinct uinstinct commented Jan 30, 2026

Description

Add reasoning_content field support. Deepseek requires reasoning support to be passed back when using tool calls.

closes #8989
resolves CON-5302

verified by changing ContinueProxy.ts

...
  constructor(options: LLMOptions) {
    super(options);
    this.configEnv = options.env;
    // This it set to `undefined` to handle the case where we are proxying requests to Azure. We pass the correct env vars
    // needed to do this in `extraBodyProperties` below, but if we don't set `apiType` to `undefined`, we end up proxying to
    // `/openai/deployments/` which is invalid since that URL construction happens on the proxy.
    this.apiType = undefined;
    this.actualApiBase = options.apiBase;
    this.apiKeyLocation = options.apiKeyLocation;
    this.envSecretLocations = options.envSecretLocations;
    this.orgScopeId = options.orgScopeId;
    this.onPremProxyUrl = options.onPremProxyUrl;
    if (this.onPremProxyUrl) {
      this.apiBase = new URL("model-proxy/v1/", this.onPremProxyUrl).toString();
    }

    // Set reasoning field support based on underlying provider
    const { provider } = parseProxyModelName(this.model);
    if (provider === "deepseek") {
      this.supportsReasoningContentField = true;
      this.supportsReasoningField = false;
    }
  }
...

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-review

Checklist

  • [] I've read the contributing guide
  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screen recording or screenshot

[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]

Tests

[ What tests were added or updated to ensure the changes work as expected? ]


Continue Tasks: ▶️ 2 queued — View all


Summary by cubic

Adds reasoning_content support to chat requests and enables it for Deepseek so tool calls receive the model’s reasoning as required. Addresses Linear CON-5302 and fixes the Deepseek tool-call behavior reported in #8989.

  • Bug Fixes
    • Added supportsReasoningContentField capability to BaseLLM and passed it through chat body creation.
    • Included reasoning_content when the previous message is role "thinking" in openaiTypeConverters, gated by provider support.
    • Configured Deepseek to use reasoning_content (supportsReasoningContentField=true, supportsReasoningField=false).

Written for commit ac93dd9. Summary will update on new commits.

@uinstinct uinstinct requested a review from a team as a code owner January 30, 2026 08:57
@uinstinct uinstinct requested review from RomneyDa and removed request for a team January 30, 2026 08:57
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jan 30, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@uinstinct uinstinct requested a review from RomneyDa February 2, 2026 13:25
@RomneyDa
Copy link
Collaborator

RomneyDa commented Feb 3, 2026

@uinstinct nice fix! Tested verified works.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Feb 3, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 3, 2026
@RomneyDa RomneyDa merged commit 6c56210 into continuedev:main Feb 3, 2026
53 of 58 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Feb 3, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 2026
@sestinj
Copy link
Contributor

sestinj commented Feb 3, 2026

🎉 This PR is included in version 1.42.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@uinstinct uinstinct deleted the deepseek-reasoningsupport branch February 3, 2026 11:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer released size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

When use deepseek v3.2 as agent, throw "400 Missing reasoning_content field in the assistant message at message index 2"

3 participants