feat(openai): add setting to disable native tool calling #10369
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR attempts to address Issue #10368. Feedback and guidance are welcome.
Summary
Adds a new user-facing setting
openAiDisableNativeToolsin the OpenAI Compatible provider settings that allows users to explicitly disable native tool calling (function calling) for models that do not support it.Problem
DeepSeek-R1 and similar models do not support native function calling (tool calling), but the OpenAI Compatible handler in Roo Code sends native tools by default, causing 400 errors. As noted by @supuwoerc, model names are impossible to exhaustively list, especially for self-trained models or proxies.
Solution
openAiDisableNativeToolssetting to the provider settings schemaOpenAiHandler.getModel()to:deepseek-r1pattern (in addition to existingdeepseek-reasoner)Changes
packages/types/src/provider-settings.ts: AddedopenAiDisableNativeToolsto OpenAI schemasrc/api/providers/openai.ts: ModifiedgetModel()to handle the new settingwebview-ui/src/components/settings/providers/OpenAICompatible.tsx: Added checkbox UIwebview-ui/src/i18n/locales/*/settings.json: Added translations for 18 localesTesting
Closes #10368