From 598f59e5469c11c5ef6ad583f0cf5130bee3614b Mon Sep 17 00:00:00 2001 From: Juan Camilo Date: Wed, 1 Apr 2026 15:34:08 +0200 Subject: [PATCH] fix: map tool_choice 'none' in OpenAI shim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Anthropic-to-OpenAI tool_choice mapping handled 'auto', 'any', and 'tool' but not 'none'. When 'none' was passed, the request was sent without tool_choice, defaulting to 'auto' — the opposite of the intended behavior (disable tool use). Relates to #30 Co-Authored-By: Juan Camilo --- src/services/api/openaiShim.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/services/api/openaiShim.ts b/src/services/api/openaiShim.ts index f7a5f6b7..53c321f6 100644 --- a/src/services/api/openaiShim.ts +++ b/src/services/api/openaiShim.ts @@ -630,6 +630,8 @@ class OpenAIShimMessages { } } else if (tc.type === 'any') { body.tool_choice = 'required' + } else if (tc.type === 'none') { + body.tool_choice = 'none' } } }