Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 29, 2025

This PR attempts to address Issue #10368. Feedback and guidance are welcome.

Summary

Adds a new user-facing setting openAiDisableNativeTools in 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

  1. Added openAiDisableNativeTools setting to the provider settings schema
  2. Modified OpenAiHandler.getModel() to:
    • Respect the new user setting when enabled
    • Also expanded DeepSeek reasoner detection to include deepseek-r1 pattern (in addition to existing deepseek-reasoner)
    • When native tools are disabled (either by user setting or model detection), the extension falls back to XML tool protocol
  3. Added UI checkbox in OpenAI Compatible settings to toggle this feature
  4. Added translations in all 18 supported locales

Changes

  • packages/types/src/provider-settings.ts: Added openAiDisableNativeTools to OpenAI schema
  • src/api/providers/openai.ts: Modified getModel() to handle the new setting
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx: Added checkbox UI
  • webview-ui/src/i18n/locales/*/settings.json: Added translations for 18 locales

Testing

  • All existing OpenAI provider tests pass (48 tests)
  • TypeScript compilation passes for packages/types, src, and webview-ui

Closes #10368

…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
@roomote
Copy link
Contributor Author

roomote bot commented Dec 29, 2025

Rooviewer Clock   See task on Roo Cloud

Review complete. No issues found.

The implementation correctly adds a new openAiDisableNativeTools setting that allows users to explicitly disable native tool calling for models that don't support it (like DeepSeek-R1). The changes follow existing patterns and properly address the issue.

  • Type schema updated correctly
  • Handler logic properly disables native tools when setting is enabled or DeepSeek reasoner detected
  • UI checkbox follows existing patterns
  • All 18 locale translations added

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Deepseek-r1 request failed in OpenAI Compatible mode.

3 participants