Skip to content

[Bug]: CherryIN gemini-3.1 AI_APICallError #16195

@Ebola-Chan-bot

Description

@Ebola-Chan-bot

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.9.11

Bug Description

使用时突然出错

Image

Steps To Reproduce

有没有动物连续学习两个任务,前一个任务A学会后对后一个任务B造成干扰,导致后一个任务B学得比初始直接学B更慢的研究?最好能到单细胞层面,发现A任务学会后的记忆细胞活跃不利于B任务的。请你搜索。

继续

Expected Behavior

正常返回结果

Relevant Log Output

错误名称: AI_APICallError
错误信息: 
堆栈信息: AI_APICallError
    at file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:82819:11
    at async postToApi$1 (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:82700:24)
    at async GoogleGenerativeAILanguageModel$1.doStream (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:87733:48)
    at async wrapStream (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:105780:32)
    at async fn (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:104430:17)
    at async file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:100701:19
    at async _retryWithExponentialBackoff (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:100891:10)
    at async streamStep (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:104399:109)
    at async fn (file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:104716:5)
    at async file:///C:/Program%20Files/Cherry%20Studio/resources/app.asar/out/renderer/assets/store-D-J5UN_L.js:100701:19
错误原因: "[undefined]"
状态码: 400
请求路径: https://open.cherryin.cc/v1beta/models/google/gemini-3.1-pro-preview:streamGenerateContent?alt=sse
请求体: {
  "generationConfig": {
    "maxOutputTokens": "[undefined]",
    "temperature": "[undefined]",
    "topK": "[undefined]",
    "topP": "[undefined]",
    "frequencyPenalty": "[undefined]",
    "presencePenalty": "[undefined]",
    "stopSequences": "[undefined]",
    "seed": "[undefined]",
    "responseMimeType": "[undefined]",
    "responseSchema": "[undefined]",
    "responseModalities": "[undefined]",
    "thinkingConfig": "[undefined]"
  },
  "contents": [
    {
      "role": "user",
      "parts": [
        {
          "text": "有没有动物连续学习两个任务,前一个任务A学会后对后一个任务B造成干扰,导致后一个任务B学得比初始直接学B更慢的研究?最好能到单细胞层面,发现A任务学会后的记忆细胞活跃不利于B任务的。请你搜索。"
        }
      ]
    },
    {
      "role": "model",
      "parts": []
    },
    {
      "role": "user",
      "parts": [
        {
          "text": "继续"
        }
      ]
    }
  ],
  "systemInstruction": {
    "parts": [
      {
        "text": "\n## Hub MCP Tools – Auto Tooling Mode\n\nYou can discover and call MCP tools through the hub server using **ONLY four meta-tools**:\n\n| Tool | Purpose |\n|------|---------|\n| `list` | List tools (paginated via `limit`/`offset`) |\n| `inspect` | Get a tool signature as JSDoc |\n| `invoke` | Call a single tool |\n| `exec` | Execute JavaScript that orchestrates multiple tool calls |\n\n### Critical Rules\n\n1. Use `list` to find the right tool. This is **tool discovery** (NOT web search).\n2. Use `inspect` before calling a tool to confirm parameter names and shapes.\n3. Use `invoke` for a single tool call.\n4. Use `exec` for multi-step flows.\n5. Inside `exec`, call tools ONLY via `mcp.callTool(name, params)`.\n6. In `exec`, you MUST explicitly `return` the final value.\n\n### What `list` Returns\n\n- A paginated list of tools.\n- The response includes: Total / Offset / Limit / Returned.\n- Each tool line includes:\n  - JS-friendly tool name (camelCase)\n  - original tool id in parentheses (serverId__toolName)\n\n### What `inspect` Returns\n\n- A JSDoc stub you can copy into `exec` code.\n\n### What `exec` Provides\n\n- `mcp.callTool(name, params)` → call a tool by JS name (camelCase) or original id (serverId__toolName)\n- `mcp.log(level, message, fields?)`\n- `parallel(...promises)` → Promise.all\n- `settle(...promises)` → Promise.allSettled\n- `console.log/info/warn/error/debug` (captured)\n\n### Example: Single Call (invoke)\n\n1) `list({ limit: 50, offset: 0 })`\n2) Pick the relevant tool name from the list.\n3) `inspect({ name: \"githubSearchRepos\" })`\n4) `invoke({ name: \"githubSearchRepos\", params: { query: \"mcp\" } })`\n\n### Example: Multi-step Flow (exec)\n\n\nconst repos = await mcp.callTool(\"githubSearchRepos\", { query: \"mcp\" })\nconsole.log(\"found\", repos)\nreturn repos\n\n"
      }
    ]
  },
  "safetySettings": [
    {
      "category": "HARM_CATEGORY_HATE_SPEECH",
      "threshold": "BLOCK_NONE"
    },
    {
      "category": "HARM_CATEGORY_DANGEROUS_CONTENT",
      "threshold": "BLOCK_NONE"
    },
    {
      "category": "HARM_CATEGORY_HARASSMENT",
      "threshold": "BLOCK_NONE"
    },
    {
      "category": "HARM_CATEGORY_SEXUALLY_EXPLICIT",
      "threshold": "BLOCK_NONE"
    },
    {
      "category": "HARM_CATEGORY_CIVIC_INTEGRITY",
      "threshold": "BLOCK_NONE"
    }
  ],
  "tools": [
    {
      "functionDeclarations": [
        {
          "name": "mcp__CherryHub__list",
          "description": "List available MCP tools from all active servers. Results are paginated via limit/offset.",
          "parameters": {
            "required": [],
            "type": "object",
            "properties": {
              "limit": {
                "description": "Optional maximum results to return (default: 30, max: 100).",
                "type": "number"
              },
              "offset": {
                "description": "Optional zero-based offset for pagination (default: 0).",
                "type": "number"
              }
            }
          }
        },
        {
          "name": "mcp__CherryHub__inspect",
          "description": "Get a single tool's signature as a JSDoc stub. Use this before `invoke` or `exec`.",
          "parameters": {
            "required": [
              "name"
            ],
            "type": "object",
            "properties": {
              "name": {
                "description": "Tool name in JS form (camelCase) OR original namespaced id (serverId__toolName).",
                "type": "string"
              }
            }
          }
        },
        {
          "name": "mcp__CherryHub__invoke",
          "description": "Call a single tool with parameters. Prefer `inspect` first to confirm parameters.",
          "parameters": {
            "required": [
              "name"
            ],
            "type": "object",
            "properties": {
              "name": {
                "description": "Tool name in JS form (camelCase) OR original namespaced id (serverId__toolName).",
                "type": "string"
              },
              "params": {
                "type": "object",
                "description": "Tool parameters as a JSON object (optional)."
              }
            }
          }
        },
        {
          "name": "mcp__CherryHub__exec",
          "description": "Execute JavaScript code to orchestrate multiple tool calls. Use `mcp.callTool(name, params)` inside the code. IMPORTANT: you MUST explicitly `return` the final value.",
          "parameters": {
            "required": [
              "code"
            ],
            "type": "object",
            "properties": {
              "code": {
                "description": "JavaScript code to execute. Available globals: `mcp.callTool(name, params)`, `mcp.log(level, message, fields?)`, `parallel(...)`, `settle(...)`, `console.*`. The code runs inside an async context so you can use `await` directly. You MUST `return` the final value.",
                "type": "string"
              }
            }
          }
        },
        {
          "name": "builtin_web_search",
          "description": "Web search tool for finding current information, news, and real-time data from the internet.\n\nThis tool has been configured with search parameters based on the conversation context:\n- Prepared queries: \"继续\n\"\n\nYou can use this tool as-is to search with the prepared queries, or provide additionalContext to refine or replace the search terms.",
          "parameters": {
            "type": "object",
            "properties": {
              "additionalContext": {
                "description": "Optional additional context, keywords, or specific focus to enhance the search",
                "type": "string"
              }
            }
          }
        }
      ]
    }
  ],
  "toolConfig": {
    "functionCallingConfig": {
      "mode": "AUTO"
    }
  },
  "cachedContent": "[undefined]",
  "labels": "[undefined]",
  "serviceTier": "[undefined]"
}
响应首部: {
  "cache-control": "no-cache",
  "content-type": "text/event-stream",
  "date": "Thu, 18 Jun 2026 10:15:33 GMT",
  "document-policy": "include-js-call-stacks-in-crash-reports",
  "server": "openresty",
  "via": "1.1 google",
  "x-new-api-version": "v0.13.2-patch-202606181144",
  "x-oneapi-request-id": "202606181015329443229028268d9d6gVe6oz2d"
}
响应内容: {
  "error": {
    "message": "Unable to submit request because it must include at least one parts field, which describes the prompt input. Learn more: https://***.com/***/***/***/***/***",
    "type": "upstream_error",
    "param": "",
    "code": 400
  }
}
数据: "[undefined]"

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ModelsCategorizes an issue or PR as relevant to SIG LLMneeds-more-infoMissing logs or need more information

    Type

    No fields configured for Bug.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions