From 156c1f4aeba0f96e6a585be4b15990da25b36353 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 2 Apr 2026 15:45:39 +0900 Subject: [PATCH] fix(models): mark gpt-4.1-mini and gpt-4.1-nano as supporting tool calls Fixes #2923 --- .../model-capabilities.generated.json | 4 +-- ...odel-capabilities-bundled-snapshot.test.ts | 34 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/shared/model-capabilities-bundled-snapshot.test.ts diff --git a/src/generated/model-capabilities.generated.json b/src/generated/model-capabilities.generated.json index 91b952581..4d51ec888 100644 --- a/src/generated/model-capabilities.generated.json +++ b/src/generated/model-capabilities.generated.json @@ -12113,7 +12113,7 @@ "family": "gpt-nano", "reasoning": false, "temperature": true, - "toolCall": false, + "toolCall": true, "modalities": { "input": [ "text", @@ -12274,7 +12274,7 @@ "family": "gpt-mini", "reasoning": false, "temperature": true, - "toolCall": false, + "toolCall": true, "modalities": { "input": [ "text", diff --git a/src/shared/model-capabilities-bundled-snapshot.test.ts b/src/shared/model-capabilities-bundled-snapshot.test.ts new file mode 100644 index 000000000..9fa742a87 --- /dev/null +++ b/src/shared/model-capabilities-bundled-snapshot.test.ts @@ -0,0 +1,34 @@ +import { describe, expect, test } from "bun:test" + +import { getBundledModelCapabilitiesSnapshot, getModelCapabilities } from "./model-capabilities" + +describe("bundled model capabilities snapshot", () => { + test("keeps GPT-4.1 OpenAI variants marked as supporting tool calls", () => { + // given + const bundledSnapshot = getBundledModelCapabilitiesSnapshot() + const modelIDs = [ + "openai/gpt-4.1", + "openai/gpt-4.1-mini", + "openai/gpt-4.1-nano", + ] + + // when + const results = modelIDs.map((modelID) => + getModelCapabilities({ + providerID: "openai", + modelID, + bundledSnapshot, + }), + ) + + // then + for (const result of results) { + expect(result.toolCall).toBe(true) + expect(result.diagnostics).toMatchObject({ + resolutionMode: "snapshot-backed", + snapshot: { source: "bundled-snapshot" }, + toolCall: { source: "bundled-snapshot" }, + }) + } + }) +})