- Update convertToolSchemaForOpenAI in base-provider.ts to use normalizeToolSchema
which properly converts type arrays (e.g., ["string", "null"]) to anyOf format
required by JSON Schema draft 2020-12
- Update Cerebras stripUnsupportedSchemaFields to handle anyOf/oneOf/allOf arrays
- Add comprehensive tests for base-provider convertToolSchemaForOpenAI function
Fixes#10320
* Add native tool calling support to OpenAI-compatible
* Fix OpenAI strict mode schema validation by adding converter methods to BaseProvider
- Add convertToolsForOpenAI() and convertToolSchemaForOpenAI() methods to BaseProvider
- These methods ensure all properties are in required array and convert nullable types
- Remove line_ranges from required array in read_file tool (converter handles it)
- Update OpenAiHandler and BaseOpenAiCompatibleProvider to use helper methods
- Eliminates code duplication across multiple tool usage sites
- Fixes: OpenAI completion error: 400 Invalid schema for function 'read_file'
---------
Co-authored-by: daniel-lxs <ricciodaniel98@gmail.com>