feat: add supportsNativeTools toggle to OpenAI-compatible custom model info

This allows users to disable native tool calling for OpenAI-compatible
models that do not properly support the OpenAI function calling format.

Users can now set supportsNativeTools: false in the custom model info
settings to fall back to XML-based tool definitions.

Closes #10477
This commit is contained in:
Roo Code 2026-01-06 08:56:58 +00:00
parent 6b13d1d84e
commit 759fc5d9a7
2 changed files with 30 additions and 0 deletions

View file

@ -420,6 +420,32 @@ export const OpenAICompatible = ({
</div>
</div>
<div>
<div className="flex items-center gap-1">
<Checkbox
checked={apiConfiguration?.openAiCustomModelInfo?.supportsNativeTools ?? true}
onChange={handleInputChange("openAiCustomModelInfo", (checked) => {
return {
...(apiConfiguration?.openAiCustomModelInfo || openAiModelInfoSaneDefaults),
supportsNativeTools: checked,
}
})}>
<span className="font-medium">
{t("settings:providers.customModel.nativeToolCalling.label")}
</span>
</Checkbox>
<StandardTooltip content={t("settings:providers.customModel.nativeToolCalling.description")}>
<i
className="codicon codicon-info text-vscode-descriptionForeground"
style={{ fontSize: "12px" }}
/>
</StandardTooltip>
</div>
<div className="text-sm text-vscode-descriptionForeground pt-1">
{t("settings:providers.customModel.nativeToolCalling.description")}
</div>
</div>
<div>
<VSCodeTextField
value={

View file

@ -475,6 +475,10 @@
"label": "Prompt Caching",
"description": "Is this model capable of caching prompts?"
},
"nativeToolCalling": {
"label": "Native Tool Calling",
"description": "Enable OpenAI-style function calling for this model. Disable if the model does not support native tool calling and falls back to XML-based tool definitions."
},
"pricing": {
"input": {
"label": "Input Price",