Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 2fe5c51

Browse files
committed
fix: enable native tool calls for Requesty provider (ROO-235)
- Add supportsNativeTools and defaultToolProtocol to Requesty model fetcher - Merge native tool defaults in RequestyHandler.getModel() for cached models - Apply same defaults merge in useSelectedModel for UI consistency - Also applied to Unbound provider for consistency The issue was that cached model data lacked the supportsNativeTools field, causing resolveToolProtocol() to return XML instead of native protocol.
1 parent 3c05cae commit 2fe5c51

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/api/providers/fetchers/requesty.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ export async function getRequestyModels(baseUrl?: string, apiKey?: string): Prom
3838
supportsImages: rawModel.supports_vision,
3939
supportsReasoningBudget: reasoningBudget,
4040
supportsReasoningEffort: reasoningEffort,
41+
supportsNativeTools: true,
42+
defaultToolProtocol: "native",
4143
inputPrice: parseApiPrice(rawModel.input_price),
4244
outputPrice: parseApiPrice(rawModel.output_price),
4345
description: rawModel.description,

src/api/providers/requesty.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,15 @@ export class RequestyHandler extends BaseProvider implements SingleCompletionHan
7979

8080
override getModel() {
8181
const id = this.options.requestyModelId ?? requestyDefaultModelId
82-
let info = this.models[id] ?? requestyDefaultModelInfo
82+
const cachedInfo = this.models[id] ?? requestyDefaultModelInfo
83+
84+
// Merge native tool defaults for cached models that may lack these fields
85+
// The order ensures that cached values (if present) override the defaults
86+
let info: ModelInfo = {
87+
supportsNativeTools: true,
88+
defaultToolProtocol: TOOL_PROTOCOL.NATIVE,
89+
...cachedInfo,
90+
}
8391

8492
// Apply tool preferences for models accessed through routers (OpenAI, Gemini)
8593
info = applyRouterToolPreferences(id, info)

webview-ui/src/components/ui/hooks/useSelectedModel.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,24 @@ function getSelectedModel({
156156
}
157157
case "requesty": {
158158
const id = getValidatedModelId(apiConfiguration.requestyModelId, routerModels.requesty, defaultModelId)
159-
const info = routerModels.requesty?.[id]
159+
const routerInfo = routerModels.requesty?.[id]
160+
// Merge native tool call defaults for cached models that may lack these fields
161+
const nativeToolDefaults = {
162+
supportsNativeTools: true,
163+
defaultToolProtocol: "native" as const,
164+
}
165+
const info = routerInfo ? { ...nativeToolDefaults, ...routerInfo } : undefined
160166
return { id, info }
161167
}
162168
case "unbound": {
163169
const id = getValidatedModelId(apiConfiguration.unboundModelId, routerModels.unbound, defaultModelId)
164-
const info = routerModels.unbound?.[id]
170+
const routerInfo = routerModels.unbound?.[id]
171+
// Merge native tool call defaults for cached models that may lack these fields
172+
const nativeToolDefaults = {
173+
supportsNativeTools: true,
174+
defaultToolProtocol: "native" as const,
175+
}
176+
const info = routerInfo ? { ...nativeToolDefaults, ...routerInfo } : undefined
165177
return { id, info }
166178
}
167179
case "litellm": {

0 commit comments

Comments
 (0)