Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 1, 2025

HTTP-type MCPs fail with AI_APICallError because tool schemas are forced into OpenAI strict mode, which requires all properties to be marked as required—breaking tools with optional parameters.

Changes

  • Remove strict: true from mcpToolsToOpenAIChatTools and mcpToolsToOpenAIResponseTools
  • Remove processSchemaForO3 transformation that forces all properties into the required array
  • Preserve original tool schemas from MCP servers without modification

Example

Before (breaks HTTP MCPs with optional params):

{
  type: 'function',
  function: {
    name: 'search_tool',
    parameters: {
      properties: { query: {...}, limit: {...} },
      required: ['query', 'limit'],  // limit was optional!
      additionalProperties: false
    },
    strict: true  // Enforces invalid schema
  }
}

After (preserves original schema):

{
  type: 'function',
  function: {
    name: 'search_tool',
    parameters: {
      properties: { query: {...}, limit: {...} },
      required: ['query']  // Only query required
    }
  }
}

The processSchemaForO3 transformation was designed specifically for O3 models. If strict mode is needed for specific models in the future, it should be applied conditionally.

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]: In version 1.6.6, all HTTP-type MCPs cause model errors</issue_title>
<issue_description>> [!NOTE]

This issue 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

v1.6.6

Bug Description

In version 1.6.6, all HTTP-type MCPs cause model errors. Loading any HTTP-type MCP causes model errors.

Steps To Reproduce

Load any HTTP-type MCP

AI_APICallError
    at file:///D:/Program/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-Z22I-dxU.js:4496:11
    at async postToApi (file:///D:/Progra0/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-Z22I-dxU.js:4378:24)
    at async OpenAICompatibleChatLanguageModel.doStream (file:///D:/Program/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:48915:48)
    at async wrapStream (file:///D:/Program%/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:41779:31)
    at async fn (file:///D:/ProF/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:39970:17)
    at async file:///D:/Program/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:37372:19
    at async _retryWithExponentialBackoff (file:///D:/Progra/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:37474:10)
    at async streamStep (file:///D:/Program%20Fil/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:39938:108)
    at async fn (file:///D:/Program)/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:40217:5)
    at async file:///D:/Program)/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:37372:19

Expected Behavior

Use MCP normally

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

v1.6.6

Bug Description

1.6.6 版本,所有http类型的MCP都会导致模型错误,加载任何 http类型的mcp都会让模型报错

Steps To Reproduce

加载任何 http类型的mcp

AI_APICallError
    at file:///D:/Program/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-Z22I-dxU.js:4496:11
    at async postToApi (file:///D:/Progra0/Cherry%20Studio/resources/app.asar/out/renderer/assets/dist-Z22I-dxU.js:4378:24)
    at async OpenAICompatibleChatLanguageModel.doStream (file:///D:/Program/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:48915:48)
    at async wrapStream (file:///D:/Program%/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:41779:31)
    at async fn (file:///D:/ProF/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:39970:17)
    at async file:///D:/Program/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:37372:19
    at async _retryWithExponentialBackoff (file:///D:/Progra/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:37474:10)
    at async streamStep (file:///D:/Program%20Fil/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-Bo1rRusY.js:39938:108)
    at async fn (file:///D:/Program)/Cherry%20St...

</details>

- Fixes CherryHQ/cherry-studio#11096

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/CherryHQ/cherry-studio/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
Copilot AI and others added 2 commits November 1, 2025 18:23
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Co-authored-by: DeJeune <67425183+DeJeune@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix model errors for HTTP-type MCPs in version 1.6.6 Nov 1, 2025
Copilot AI requested a review from DeJeune November 1, 2025 18:31
Copilot finished work on behalf of DeJeune November 1, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants