{"record":{"id":"ee72bf0d54d1f324","repo":"continuedev/continue","slug":"unsupported-tool-call-type-in-gemini-toolcall-t","errorCode":null,"errorMessage":"Unsupported tool call type in Gemini: ${toolCall.type}","messagePattern":"Unsupported tool call type in Gemini: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/Gemini.ts","lineNumber":196,"sourceCode":"                      // Fallback per https://ai.google.dev/gemini-api/docs/thought-signatures\n                      // for histories that were not generated by Gemini or are missing signatures.\n                      thoughtSignature = \"skip_thought_signature_validator\";\n                    }\n                  }\n\n                  return {\n                    functionCall: {\n                      id: includeToolCallIds ? toolCall.id : undefined,\n                      name: toolCall.function.name,\n                      args: safeParseArgs(\n                        toolCall.function.arguments,\n                        `Call: ${toolCall.function.name} ${toolCall.id}`,\n                      ),\n                    },\n                    ...(thoughtSignature && { thoughtSignature }),\n                  };\n                }\n                throw new Error(\n                  `Unsupported tool call type in Gemini: ${toolCall.type}`,\n                );\n              },\n            ),\n          };\n        }\n\n        if (msg.role === \"tool\") {\n          const functionName = toolCallIdToNameMap.get(msg.tool_call_id);\n          return {\n            role: \"user\" as const,\n            parts: [\n              {\n                functionResponse: {\n                  id: includeToolCallIds ? msg.tool_call_id : undefined,\n                  name: functionName ?? \"unknown\",\n                  response: {\n                    content:","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/Gemini.ts#L178-L214","documentation":"The Gemini adapter throws when converting tool calls whose `type` field is not the expected function-call shape (e.g. type: 'custom' or a malformed type string). Only 'function' tool calls are translated to Gemini's functionCall parts.","triggerScenarios":"Sending a message with tool_calls entries whose type is anything other than 'function' (custom tool types, provider-specific extensions), or replaying assistant messages from another provider verbatim.","commonSituations":"Cross-provider message replay — history captured from a provider with custom tool types then sent to Gemini; hand-built tool_call objects with missing/misspelled type.","solutions":["Filter or map non-function tool calls before sending history to Gemini.","Ensure tool calls you construct use type: 'function'.","Re-serialize tool results as plain text if the custom type can't be expressed."],"exampleFix":"// before\nmessages: [...historyWithCustomToolCalls]\n// after\nmessages: history.filter(m => (m.tool_calls ?? []).every(tc => tc.type === 'function'))","handlingStrategy":"validation","validationCode":"const msgs = history.map(m => ({ ...m, tool_calls: m.tool_calls?.filter(tc => tc.type === 'function') }));","typeGuard":"const isFunctionToolCall = (tc: any): tc is { type: 'function'; id: string; function: { name: string; arguments: string } } => tc?.type === 'function' && typeof tc?.function?.name === 'string';","tryCatchPattern":"catch (e) { if (/Unsupported tool call type/.test(e.message)) return sanitizeToolCallsAndRetry(); throw e; }","preventionTips":["Never replay another provider's raw tool_call history to Gemini.","Always set type: 'function' when constructing tool calls."],"tags":["gemini","tool-calls","unsupported-feature"],"backgroundTag":"unsupported-tool-call-type","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}