Description
Using Gemini API models (e.g., gemini-2.5-flash) on Linux Debian Gnome (flathub version) with any MCP Server enabled (Google Search, Sequential Thinking) causes immediate generation failure when a tool is invoked.
The application throws a Type validation failed error targeting the index field within choices[0].delta.tool_calls. It appears the validation schema for tool calls is incompatible with the specific response structure returned by the Gemini API adapter.
Note: Disabling "Stream" in the assistant settings does not resolve the issue.
Steps to Reproduce
- Select a Gemini model via API.
- Enable any MCP Server (e.g., Google Search).
- Send a prompt that triggers a tool call (e.g., "Search for the next lottery date").
- Error occurs immediately.
Error Log
Error generating response
Type validation failed: Value: {"choices":[{"delta":{"role":"assistant","tool_calls":[{"function":{"arguments":"...","name":"google_search"},"id":"...","type":"function"}]},"finish_reason":"tool_calls","index":0}],"created":...}
Error message: [{"code":"invalid_union","errors":[[{"expected":"number","code":"invalid_type","path":["choices",0,"delta","tool_calls",0,"index"],"message":"Invalid input"}]],[{"expected":"object","code":"invalid_type","path":["error"],"message":"Invalid input"}]],"path":[],"message":"Invalid input"}]
Description
Using Gemini API models (e.g.,
gemini-2.5-flash) on Linux Debian Gnome (flathub version) with any MCP Server enabled (Google Search, Sequential Thinking) causes immediate generation failure when a tool is invoked.The application throws a
Type validation failederror targeting theindexfield withinchoices[0].delta.tool_calls. It appears the validation schema for tool calls is incompatible with the specific response structure returned by the Gemini API adapter.Note: Disabling "Stream" in the assistant settings does not resolve the issue.
Steps to Reproduce
Error Log