fix: default OpenAI Compatible provider to XML protocol for better third-party proxy compatibility #10248
+9
−4
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.
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
nativetoxml.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:
openAiModelInfoSaneDefaultshaddefaultToolProtocol: "native"Solution:
defaultToolProtocolinopenAiModelInfoSaneDefaultsfrom"native"to"xml"Changes:
packages/types/src/providers/openai.ts: ChangeddefaultToolProtocolfrom"native"to"xml"inopenAiModelInfoSaneDefaultssrc/utils/__tests__/resolveToolProtocol.spec.ts: Updated test to expect XML protocol for OpenAI Compatible providerTest Procedure
Pre-Submission Checklist
Screenshots / Videos
N/A - configuration change
Documentation Updates
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!