-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(openai): add setting to disable native tool calling #10369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…hat do not support it - Add openAiDisableNativeTools setting to provider-settings schema - Modify OpenAiHandler.getModel() to respect the new setting - Expand DeepSeek reasoner detection to include deepseek-r1 pattern - Add UI checkbox in OpenAI Compatible settings - Add translations for the new setting in all 18 supported locales This addresses the issue where DeepSeek-R1 and similar models return 400 errors when native function calling (tools) is included in the request. Users can now explicitly disable native tools via a setting, giving them control when model name detection is insufficient (e.g., custom models or proxies). Closes #10368
Review complete. No issues found. The implementation correctly adds a new
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
@roomote A test case failed during execution in cicd, preventing the PR from entering the ready state. |
Investigated CI failures - they were infrastructure-related (flaky tests/timeouts), not code issues. Added test coverage for the new |
|
@supuwoerc We will be removing the XML logic shortly. Keeping two tool calling architectures massively increases complexity. Every fix, every feature, every tool-related issue forces Roo to reason about two completely different execution paths. That slows development, increases bugs, and makes it harder to move Roo forward. It also guarantees that XML users would slowly get stuck with an increasingly outdated experience as improvements land only in the native path. https://blog.roocode.com/p/sorry-we-didnt-listen-sooner-native |
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