Skip to content

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: ▶️ 1 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

if (includeReasoning) {
msg.reasoning = prevMessage.content as string;
}
if (includeReasoningContent) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

consider else if, nbl

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think these if conditions are independent (includeReasoningContent can be present alongside includeReasoning)

@uinstinct uinstinct requested a review from RomneyDa February 2, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: Todo

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"

2 participants