From d785bf7e69befff543e031875caba305a9d413bf Mon Sep 17 00:00:00 2001 From: GokayAI <60583610+gokay-ai@users.noreply.github.com> Date: Tue, 22 Sep 2026 03:05:04 +0000 Subject: [PATCH] fix(providers): set strict:false on chat-completions tools (#12272) Signed-off-by: GokayAI <60583610+gokay-ai@users.noreply.github.com> --- crates/goose-provider-types/src/formats/openai.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/goose-provider-types/src/formats/openai.rs b/crates/goose-provider-types/src/formats/openai.rs index 260c0dc2c..1ee3d9b0a 100644 --- a/crates/goose-provider-types/src/formats/openai.rs +++ b/crates/goose-provider-types/src/formats/openai.rs @@ -678,6 +678,7 @@ pub fn format_tools(tools: &[Tool]) -> anyhow::Result> { "name": tool.name, "description": tool.description, "parameters": tool.input_schema, + "strict": false, } })); } @@ -2259,6 +2260,11 @@ mod tests { assert_eq!(spec.len(), 1); assert_eq!(spec[0]["type"], "function"); assert_eq!(spec[0]["function"]["name"], "test_tool"); + assert_eq!( + spec[0]["function"]["strict"], + json!(false), + "Some chat-completions upstreams default strict to true when the flag is absent, but MCP tool schemas are not strict-compatible; must explicitly set strict: false" + ); Ok(()) }