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

Commit 3970acf

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 bb358fb commit 3970acf

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
@@ -157,12 +157,24 @@ function getSelectedModel({
157157
}
158158
case "requesty": {
159159
const id = getValidatedModelId(apiConfiguration.requestyModelId, routerModels.requesty, defaultModelId)
160-
const info = routerModels.requesty?.[id]
160+
const routerInfo = routerModels.requesty?.[id]
161+
// Merge native tool call defaults for cached models that may lack these fields
162+
const nativeToolDefaults = {
163+
supportsNativeTools: true,
164+
defaultToolProtocol: "native" as const,
165+
}
166+
const info = routerInfo ? { ...nativeToolDefaults, ...routerInfo } : undefined
161167
return { id, info }
162168
}
163169
case "unbound": {
164170
const id = getValidatedModelId(apiConfiguration.unboundModelId, routerModels.unbound, defaultModelId)
165-
const info = routerModels.unbound?.[id]
171+
const routerInfo = routerModels.unbound?.[id]
172+
// Merge native tool call defaults for cached models that may lack these fields
173+
const nativeToolDefaults = {
174+
supportsNativeTools: true,
175+
defaultToolProtocol: "native" as const,
176+
}
177+
const info = routerInfo ? { ...nativeToolDefaults, ...routerInfo } : undefined
166178
return { id, info }
167179
}
168180
case "litellm": {

0 commit comments

Comments
 (0)