Skip to content

Commit 02c10d7

Browse files
author
Guo Zhanfan
committed
fix(thinking): keep xhigh hints aligned with provider support
1 parent 056ea53 commit 02c10d7

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎src/auto-reply/thinking.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ describe("listThinkingLevels", () => {
168168
expect(supportsXHighThinking("zai", "gpt-5.4", source)).toBe(false);
169169
expect(listThinkingLevels("zai", "gpt-5.4", source)).not.toContain("xhigh");
170170
expect(listThinkingLevelLabels("zai", "gpt-5.4", source)).toEqual(["off", "on"]);
171+
expect(formatXHighModelHint(source)).toBe(formatXHighModelHint());
171172
});
172173

173174
it("always includes adaptive", () => {

‎src/auto-reply/thinking.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,11 @@ function resolveExplicitXHighOverride(
130130

131131
function collectExplicitXHighRefs(
132132
source?: ThinkingSupportSource,
133-
): Array<{ ref: string; supported: boolean }> {
134-
const out = new Map<string, { ref: string; supported: boolean }>();
133+
): Array<{ provider?: string | null; model?: string | null; ref: string; supported: boolean }> {
134+
const out = new Map<
135+
string,
136+
{ provider?: string | null; model?: string | null; ref: string; supported: boolean }
137+
>();
135138

136139
const add = (provider?: string | null, model?: string | null, supported?: unknown) => {
137140
if (typeof supported !== "boolean") {
@@ -141,7 +144,7 @@ function collectExplicitXHighRefs(
141144
if (!ref) {
142145
return;
143146
}
144-
out.set(ref, { ref, supported });
147+
out.set(ref, { provider, model, ref, supported });
145148
};
146149

147150
const providers = source?.config?.models?.providers;
@@ -179,7 +182,7 @@ function collectExplicitXHighRefs(
179182

180183
function listSupportedXHighModelRefs(source?: ThinkingSupportSource): string[] {
181184
return collectExplicitXHighRefs(source)
182-
.filter((entry) => entry.supported)
185+
.filter((entry) => entry.supported && !isBinaryThinkingProvider(entry.provider, entry.model))
183186
.map((entry) => entry.ref);
184187
}
185188

0 commit comments

Comments
 (0)