fix: default OpenAI Compatible provider to XML protocol for better third-party proxy compatibility #10260
+13
−6
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 #10259.
Problem
In version 3.36.15, PR #10213 introduced a change that merges native tool defaults (
supportsNativeTools: true,defaultToolProtocol: "native") for the OpenAI Compatible provider. This caused a regression where users with custom model configurations (like DeepSeek-R1 via LiteLLM proxy) who did not explicitly setdefaultToolProtocolwould now receive native tool calls, which many third-party proxies do not support.The error manifests as:
500 Internal server error: Unsupported tool_call_parser: NoneSolution
Change
openAiModelInfoSaneDefaults.defaultToolProtocolfrom"native"to"xml"for the OpenAI Compatible provider.This ensures better compatibility with third-party proxies by defaulting to XML-based tool calling. Users who want native tool calling can still explicitly enable it in Advanced Settings.
Changes
packages/types/src/providers/openai.ts: ChangeddefaultToolProtocolfrom"native"to"xml"foropenAiModelInfoSaneDefaultssrc/utils/__tests__/resolveToolProtocol.spec.tswebview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.tsFeedback and guidance are welcome.