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:
@@ -612,6 +612,7 @@ function convertTools(tools: Tool[]): OpenAI.Chat.Completions.ChatCompletionTool
|
|||||||
name: tool.name,
|
name: tool.name,
|
||||||
description: tool.description,
|
description: tool.description,
|
||||||
parameters: tool.parameters as any, // TypeBox already generates JSON Schema
|
parameters: tool.parameters as any, // TypeBox already generates JSON Schema
|
||||||
|
strict: false, // Disable strict mode to allow optional parameters without null unions
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user