Skip to content

Commit 30b833c

Browse files
steebchenclaude
andcommitted
fix(gateway): disable thinking for qwen3.6-35b-a3b json mode
Re-enables jsonOutput on the model and disables thinking only when JSON response_format is requested, since combining both upstream returns empty content ~40% of the time. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 283b507 commit 30b833c

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

packages/actions/src/prepare-request-body.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,6 +1031,17 @@ export async function prepareRequestBody(
10311031
}
10321032
}
10331033

1034+
// qwen3.6-35b-a3b returns empty content ~40% of the time when json_object
1035+
// is combined with thinking; force thinking off when JSON is requested.
1036+
if (
1037+
usedProvider === "alibaba" &&
1038+
usedModel === "qwen3.6-35b-a3b" &&
1039+
(response_format?.type === "json_object" ||
1040+
response_format?.type === "json_schema")
1041+
) {
1042+
requestBody.enable_thinking = false;
1043+
}
1044+
10341045
if (forcesToolUse && usedProvider === "moonshot") {
10351046
const providerMapping = modelDef?.providers.find(
10361047
(p) => p.modelName === usedModel && p.providerId === usedProvider,

packages/models/src/models/alibaba.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2357,9 +2357,7 @@ export const alibabaModels = [
23572357
tools: true,
23582358
webSearch: true,
23592359
webSearchPrice: 0.01,
2360-
// json_object mode in thinking mode returns empty content ~40% of the time;
2361-
// disabled until Alibaba fixes the upstream behavior
2362-
jsonOutput: false,
2360+
jsonOutput: true,
23632361
// Qwen thinking models reject tool_choice "required" or object
23642362
supportedParameters: [
23652363
"temperature",
@@ -2369,6 +2367,7 @@ export const alibabaModels = [
23692367
"presence_penalty",
23702368
"stop",
23712369
"stream",
2370+
"response_format",
23722371
"tools",
23732372
],
23742373
},

0 commit comments

Comments
 (0)