Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Dec 21, 2025

Related GitHub Issue

Relates to: #10246

Roo Code Task Context (Optional)

This PR was created with the assistance of Roo Code to address user feedback.

Description

This PR attempts to address Issue #10246 by changing the default Tool Protocol for OpenAI Compatible providers from native to xml.

Problem:
Users of third-party API proxies (OpenAI Compatible providers) frequently encounter the error message "The model provided text/reasoning but did not call any required tools" (模型提供了文本/推理,但未调用任何必需的工具). This occurs because:

  1. The default openAiModelInfoSaneDefaults had defaultToolProtocol: "native"
  2. Third-party API proxies have varying levels of support for native OpenAI function calling
  3. When the proxy does not properly translate/support native tool calls, the model responds with text only, triggering the error

Solution:

  • Changed defaultToolProtocol in openAiModelInfoSaneDefaults from "native" to "xml"
  • XML tool calling is more universally supported across different API proxies
  • Users who want native tool calling can still explicitly enable it in Advanced Settings > Tool Protocol

Changes:

  • packages/types/src/providers/openai.ts: Changed defaultToolProtocol from "native" to "xml" in openAiModelInfoSaneDefaults
  • src/utils/__tests__/resolveToolProtocol.spec.ts: Updated test to expect XML protocol for OpenAI Compatible provider

Test Procedure

  1. Configure an OpenAI Compatible provider with a third-party API proxy (e.g., using Claude models)
  2. Start a task that requires tool use
  3. Verify that the system uses XML tool protocol by default
  4. Verify that tool calls work correctly without the "no tools used" error

Pre-Submission Checklist

Screenshots / Videos

N/A - configuration change

Documentation Updates

  • No documentation updates are required.

Additional Notes

This change prioritizes compatibility for users of third-party API proxies, which is the primary use case for OpenAI Compatible providers. Users who connect to native OpenAI API or proxies with full native tool support can still explicitly set Tool Protocol to "Native" in Advanced Settings.

This complements PR #10247 which improved the error message guidance. This PR addresses the root cause by changing the default to the more compatible option.

Feedback and guidance are welcome!

@roomote
Copy link
Contributor Author

roomote bot commented Dec 21, 2025

Rooviewer Clock   See task on Roo Cloud

Review completed. Found 1 issue that needs to be addressed before merging.

  • Update tests in webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts to expect "xml" instead of "native" for defaultToolProtocol

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

Comment on lines +554 to +557
// Default to XML for OpenAI Compatible providers since third-party proxies
// have varying levels of support for native tool calling. Users who want
// native tool calling can explicitly enable it in Advanced Settings.
defaultToolProtocol: "xml",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will cause test failures in webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts. Lines 705 and 737 expect defaultToolProtocol to be "native", but this change sets it to "xml". Those tests need to be updated to expect "xml" instead.

Fix it with Roo Code or mention @roomote and request a fix.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 21, 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.

3 participants