Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 4, 2025

GitHub Copilot was not passing the reasoning_effort parameter for GPT-5/o1/o3/o4 thinking models. The parameter was being sent in a deprecated format that the OpenAI SDK silently discards.

Root Cause

OpenAIAPIClient.getReasoningEffort() returned { reasoning_effort: "medium" } for all reasoning models. Per SDK type definitions, reasoning_effort is deprecated for OpenAI-compatible providers and gets overwritten to undefined.

Changes

Production code (7 lines):

  • Detect OpenAI models (GPT-5, o1, o3, o4) via isSupportedReasoningEffortOpenAIModel()
  • Delegate to base class OpenAIBaseClient.getReasoningEffort() which returns correct { reasoning: { effort, summary } } format
  • Non-OpenAI models (Grok, Perplexity) continue using reasoning_effort parameter

Test coverage:

  • Added unit tests for GPT-5, o1, o3, Grok, and Perplexity models
  • Verified both with and without reasoning_effort setting
// Before (broken for GitHub Copilot + GPT-5)
if (isSupportedReasoningEffortModel(model)) {
  return { reasoning_effort: reasoningEffort }  // Silently discarded by SDK
}

// After (fixed)
if (isSupportedReasoningEffortModel(model)) {
  if (isSupportedReasoningEffortOpenAIModel(model)) {
    return super.getReasoningEffort(assistant, model)  // Returns { reasoning: { effort, summary } }
  }
  return { reasoning_effort: reasoningEffort }  // For Grok/Perplexity
}

Impact

  • ✅ GitHub Copilot + GPT-5/o1/o3/o4 models now respect reasoning level settings
  • ✅ No changes to Grok, Perplexity, OpenRouter, or OpenAI providers

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cdn.sheetjs.com
    • Triggering command: /usr/local/bin/node /home/REDACTED/work/cherry-studio/cherry-studio/.yarn/releases/yarn-4.9.1.cjs install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Github Copilot doesn't properly pass reasoning_effort parameter when calling thinking models</issue_title>
<issue_description>> [!NOTE]

This issue/comment/review was translated by Claude.

Issue Checklist

  • I understand that issues are for feedback and problem solving, not for complaining in the comment section, and will provide as much information as possible to help solve the problem.
  • My issue is not listed in the FAQ.
  • I've looked at pinned issues and searched for existing Open Issues, Closed Issues, and Discussions, no similar issue or discussion was found.
  • I've filled in short, clear headings so that developers can quickly identify a rough idea of what to expect when flipping through the list of issues. And not "a suggestion", "stuck", etc.
  • I've confirmed that I am using the latest version of Cherry Studio.

Platform

Windows

Version

v.1.6.7

Bug Description

In v.1.6.7, when sending requests to thinking models like gpt5 mini, the reasoning level doesn't take effect. Checking the debug tool reveals that the reasoning_effort parameter is not being passed. It was passed in v.1.6.6.

Steps To Reproduce

  1. Adjust reasoning level
  2. Send request to thinking models like gpt5 mini
  3. Check request body

Expected Behavior

reasoning_effort should be passed

Relevant Log Output

Additional Context

No response


Original Content

Issue Checklist

  • I understand that issues are for feedback and problem solving, not for complaining in the comment section, and will provide as much information as possible to help solve the problem.
  • My issue is not listed in the FAQ.
  • I've looked at pinned issues and searched for existing Open Issues, Closed Issues, and Discussions, no similar issue or discussion was found.
  • I've filled in short, clear headings so that developers can quickly identify a rough idea of what to expect when flipping through the list of issues. And not "a suggestion", "stuck", etc.
  • I've confirmed that I am using the latest version of Cherry Studio.

Platform

Windows

Version

v.1.6.7

Bug Description

在v.1.6.7中,向思考模型如gpt5 mini发送请求,思考程度不生效,查看调试工具发现没有传入reasoning_effort参数。在v.1.6.6是传入的。

Steps To Reproduce

  1. 调整思考程度
  2. 向思考模型如gpt5 mini发送请求
  3. 查看请求体

Expected Behavior

应该传入reasoning_effort

Relevant Log Output

Additional Context

No response

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix reasoning_effort parameter handling in thinking models Fix GitHub Copilot reasoning_effort parameter format for GPT-5 models Nov 4, 2025
Copilot AI requested a review from GeorgeDong32 November 4, 2025 12:55
Copilot finished work on behalf of GeorgeDong32 November 4, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Github Copilot doesn't properly pass reasoning_effort parameter when calling thinking models

2 participants