From ed68f4b21ebe996ac5582320d019ffc04a76d02a Mon Sep 17 00:00:00 2001 From: Badri Narayanan S Date: Sat, 17 Jan 2026 14:47:48 +0530 Subject: [PATCH] fix: enable strict tool parameter validation for Claude models Set functionCallingConfig.mode = 'VALIDATED' when using Claude models to ensure strict parameter validation, matching opencode-antigravity-auth. Co-Authored-By: Claude --- src/format/request-converter.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/format/request-converter.js b/src/format/request-converter.js index da2d9da..9ec1416 100644 --- a/src/format/request-converter.js +++ b/src/format/request-converter.js @@ -226,6 +226,16 @@ export function convertAnthropicToGoogle(anthropicRequest) { googleRequest.tools = [{ functionDeclarations }]; logger.debug(`[RequestConverter] Tools: ${JSON.stringify(googleRequest.tools).substring(0, 300)}`); + + // For Claude models, set functionCallingConfig.mode = "VALIDATED" + // This ensures strict parameter validation (matches opencode-antigravity-auth) + if (isClaudeModel) { + googleRequest.toolConfig = { + functionCallingConfig: { + mode: 'VALIDATED' + } + }; + } } // Cap max tokens for Gemini models