fix(ai): disable strict mode for OpenAI completions tool schemas

OpenRouter with models like openai/gpt-5.2 enforces strict mode which
requires all properties in the required array. Setting strict: false
allows optional parameters without null unions, matching the approach
already used in openai-responses.ts.
This commit is contained in:
Mario Zechner 2026-01-10 00:19:02 +01:00
parent fe98895706
commit a613306e11

View file

@ -612,6 +612,7 @@ function convertTools(tools: Tool[]): OpenAI.Chat.Completions.ChatCompletionTool
name: tool.name,
description: tool.description,
parameters: tool.parameters as any, // TypeBox already generates JSON Schema
strict: false, // Disable strict mode to allow optional parameters without null unions
},
}));
}