Skip to content

Commit 5908d18

Browse files
committed
fix: tool support tests
1 parent 7b036c6 commit 5908d18

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

core/llm/toolSupport.test.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -179,17 +179,11 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
179179
});
180180

181181
it("should return undefined for Claude Haiku and Opus models", () => {
182-
expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(
183-
false,
184-
);
185-
expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(
186-
false,
187-
);
188-
expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(
189-
false,
190-
);
191-
expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(false);
192-
expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(false);
182+
expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(true);
183+
expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(true);
184+
expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(true);
185+
expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(true);
186+
expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(true);
193187
});
194188

195189
it("should return undefined for other unsupported models", () => {

core/llm/toolSupport.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
1919
);
2020
},
2121
anthropic: (model) => {
22+
if (model.includes("claude-2") || model.includes("claude-instant")) {
23+
return false;
24+
}
2225
if (["claude"].some((part) => model.toLowerCase().startsWith(part))) {
2326
return true;
2427
}
@@ -100,15 +103,12 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
100103
);
101104
},
102105
bedrock: (model) => {
106+
if (model.includes("claude-2") || model.includes("claude-instant")) {
107+
return false;
108+
}
103109
if (
104110
[
105-
"claude-3-5-sonnet",
106-
"claude-3.5-sonnet",
107-
"claude-3-7-sonnet",
108-
"claude-3.7-sonnet",
109-
"claude-sonnet-4",
110-
"claude-4-sonnet",
111-
"claude-opus-4",
111+
"claude",
112112
"nova-lite",
113113
"nova-pro",
114114
"nova-micro",
@@ -255,8 +255,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
255255
"openai/o3",
256256
"openai/o4",
257257
"openai/gpt-oss",
258-
"anthropic/claude-3",
259-
"anthropic/claude-4",
258+
"anthropic/claude",
260259
"microsoft/phi-3",
261260
"google/gemini-flash-1.5",
262261
"google/gemini-2",
@@ -366,7 +365,8 @@ export function isRecommendedAgentModel(modelName: string): boolean {
366365
const recs: RegExp[][] = [
367366
[/o[134]/],
368367
[/deepseek/, /r1|reasoner/],
369-
[/gemini/, /2\.5|3/, /pro/],
368+
[/gemini/, /2\.5/, /pro/],
369+
[/gemini/, /3-pro/],
370370
[/gpt/, /-5|5\.1/],
371371
[/claude/, /sonnet/, /3\.7|3-7|-4/],
372372
[/claude/, /opus/, /-4/],

0 commit comments

Comments
 (0)