Skip to content

Commit 8342ce9

Browse files
committed
refactor: rename supportsReasoning to supportsReasoningBinary for clarity
- Rename supportsReasoning -> supportsReasoningBinary in model schema - Update Z.AI GLM model configurations to use supportsReasoningBinary - Update Z.AI provider logic in createStream and completePrompt methods - Update ThinkingBudget UI component and tests - Update all test comments and expectations This change improves naming clarity by distinguishing between: - supportsReasoningBinary: Simple on/off reasoning toggle - supportsReasoningBudget: Advanced reasoning with token budget controls - supportsReasoningEffort: Advanced reasoning with effort levels
1 parent 585dd31 commit 8342ce9

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

packages/types/src/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export const modelInfoSchema = z.object({
6161
// Capability flag to indicate whether the model supports an output verbosity parameter
6262
supportsVerbosity: z.boolean().optional(),
6363
supportsReasoningBudget: z.boolean().optional(),
64-
// Capability flag to indicate whether the model supports simple on/off reasoning
65-
supportsReasoning: z.boolean().optional(),
64+
// Capability flag to indicate whether the model supports simple on/off binary reasoning
65+
supportsReasoningBinary: z.boolean().optional(),
6666
// Capability flag to indicate whether the model supports temperature parameter
6767
supportsTemperature: z.boolean().optional(),
6868
requiredReasoningBudget: z.boolean().optional(),

packages/types/src/providers/zai.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const internationalZAiModels = {
1616
contextWindow: 131_072,
1717
supportsImages: false,
1818
supportsPromptCache: true,
19-
supportsReasoning: true,
19+
supportsReasoningBinary: true,
2020
inputPrice: 0.6,
2121
outputPrice: 2.2,
2222
cacheWritesPrice: 0,
@@ -87,7 +87,7 @@ export const internationalZAiModels = {
8787
contextWindow: 200_000,
8888
supportsImages: false,
8989
supportsPromptCache: true,
90-
supportsReasoning: true,
90+
supportsReasoningBinary: true,
9191
inputPrice: 0.6,
9292
outputPrice: 2.2,
9393
cacheWritesPrice: 0,
@@ -116,7 +116,7 @@ export const mainlandZAiModels = {
116116
contextWindow: 131_072,
117117
supportsImages: false,
118118
supportsPromptCache: true,
119-
supportsReasoning: true,
119+
supportsReasoningBinary: true,
120120
inputPrice: 0.29,
121121
outputPrice: 1.14,
122122
cacheWritesPrice: 0,
@@ -187,7 +187,7 @@ export const mainlandZAiModels = {
187187
contextWindow: 204_800,
188188
supportsImages: false,
189189
supportsPromptCache: true,
190-
supportsReasoning: true,
190+
supportsReasoningBinary: true,
191191
inputPrice: 0.29,
192192
outputPrice: 1.14,
193193
cacheWritesPrice: 0,

src/api/providers/__tests__/zai.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ describe("ZAiHandler", () => {
299299
describe("Reasoning functionality", () => {
300300
it("should include thinking parameter when enableReasoningEffort is true and model supports reasoning in createMessage", async () => {
301301
const handlerWithReasoning = new ZAiHandler({
302-
apiModelId: "glm-4.6", // GLM-4.6 has supportsReasoning: true
302+
apiModelId: "glm-4.6", // GLM-4.6 has supportsReasoningBinary: true
303303
zaiApiKey: "test-zai-api-key",
304304
zaiApiLine: "international_coding",
305305
enableReasoningEffort: true,
@@ -331,7 +331,7 @@ describe("ZAiHandler", () => {
331331

332332
it("should not include thinking parameter when enableReasoningEffort is false in createMessage", async () => {
333333
const handlerWithoutReasoning = new ZAiHandler({
334-
apiModelId: "glm-4.6", // GLM-4.6 has supportsReasoning: true
334+
apiModelId: "glm-4.6", // GLM-4.6 has supportsReasoningBinary: true
335335
zaiApiKey: "test-zai-api-key",
336336
zaiApiLine: "international_coding",
337337
enableReasoningEffort: false,
@@ -363,7 +363,7 @@ describe("ZAiHandler", () => {
363363

364364
it("should not include thinking parameter when model does not support reasoning in createMessage", async () => {
365365
const handlerWithNonReasoningModel = new ZAiHandler({
366-
apiModelId: "glm-4-32b-0414-128k", // This model doesn't have supportsReasoning: true
366+
apiModelId: "glm-4-32b-0414-128k", // This model doesn't have supportsReasoningBinary: true
367367
zaiApiKey: "test-zai-api-key",
368368
zaiApiLine: "international_coding",
369369
enableReasoningEffort: true,
@@ -395,7 +395,7 @@ describe("ZAiHandler", () => {
395395

396396
it("should include thinking parameter when enableReasoningEffort is true and model supports reasoning in completePrompt", async () => {
397397
const handlerWithReasoning = new ZAiHandler({
398-
apiModelId: "glm-4.5", // GLM-4.5 has supportsReasoning: true
398+
apiModelId: "glm-4.5", // GLM-4.5 has supportsReasoningBinary: true
399399
zaiApiKey: "test-zai-api-key",
400400
zaiApiLine: "international_coding",
401401
enableReasoningEffort: true,
@@ -415,7 +415,7 @@ describe("ZAiHandler", () => {
415415

416416
it("should not include thinking parameter when enableReasoningEffort is false in completePrompt", async () => {
417417
const handlerWithoutReasoning = new ZAiHandler({
418-
apiModelId: "glm-4.5", // GLM-4.5 has supportsReasoning: true
418+
apiModelId: "glm-4.5", // GLM-4.5 has supportsReasoningBinary: true
419419
zaiApiKey: "test-zai-api-key",
420420
zaiApiLine: "international_coding",
421421
enableReasoningEffort: false,

src/api/providers/zai.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ZAiHandler extends BaseOpenAiCompatibleProvider<string> {
6868

6969
// Add thinking parameter if reasoning is enabled and model supports it
7070
const { id: modelId, info: modelInfo } = this.getModel()
71-
if (this.options.enableReasoningEffort && modelInfo.supportsReasoning) {
71+
if (this.options.enableReasoningEffort && modelInfo.supportsReasoningBinary) {
7272
;(params as any).thinking = { type: "enabled" }
7373
}
7474

@@ -89,7 +89,7 @@ export class ZAiHandler extends BaseOpenAiCompatibleProvider<string> {
8989

9090
// Add thinking parameter if reasoning is enabled and model supports it
9191
const { info: modelInfo } = this.getModel()
92-
if (this.options.enableReasoningEffort && modelInfo.supportsReasoning) {
92+
if (this.options.enableReasoningEffort && modelInfo.supportsReasoningBinary) {
9393
;(params as any).thinking = { type: "enabled" }
9494
}
9595

webview-ui/src/components/settings/ThinkingBudget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const ThinkingBudget = ({ apiConfiguration, setApiConfigurationField, mod
4848
const minThinkingTokens = isGemini25Pro ? GEMINI_25_PRO_MIN_THINKING_TOKENS : 1024
4949

5050
// Check model capabilities
51-
const isReasoningSupported = !!modelInfo && modelInfo.supportsReasoning
51+
const isReasoningSupported = !!modelInfo && modelInfo.supportsReasoningBinary
5252
const isReasoningBudgetSupported = !!modelInfo && modelInfo.supportsReasoningBudget
5353
const isReasoningBudgetRequired = !!modelInfo && modelInfo.requiredReasoningBudget
5454
const isReasoningEffortSupported = !!modelInfo && modelInfo.supportsReasoningEffort
@@ -104,7 +104,7 @@ export const ThinkingBudget = ({ apiConfiguration, setApiConfigurationField, mod
104104
return null
105105
}
106106

107-
// Models with supportsReasoning (binary reasoning) show a simple on/off toggle
107+
// Models with supportsReasoningBinary (binary reasoning) show a simple on/off toggle
108108
if (isReasoningSupported) {
109109
return (
110110
<div className="flex flex-col gap-1">

webview-ui/src/components/settings/__tests__/ThinkingBudget.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ describe("ThinkingBudget", () => {
7777
expect(container.firstChild).toBeNull()
7878
})
7979

80-
it("should render simple reasoning toggle when model has supportsReasoning (binary reasoning)", () => {
80+
it("should render simple reasoning toggle when model has supportsReasoningBinary (binary reasoning)", () => {
8181
render(
8282
<ThinkingBudget
8383
{...defaultProps}
8484
modelInfo={{
8585
...mockModelInfo,
86-
supportsReasoning: true,
86+
supportsReasoningBinary: true,
8787
supportsReasoningBudget: false,
8888
supportsReasoningEffort: false,
8989
}}

0 commit comments

Comments
 (0)