From e28255edb6f0955332e827bb706bbcd6465d1ff6 Mon Sep 17 00:00:00 2001 From: Mingholy Date: Tue, 14 Oct 2025 15:40:20 +0800 Subject: [PATCH] fix: token limits for qwen3-max (#724) --- .vscode/launch.json | 11 +++++++++++ packages/core/src/core/tokenLimits.ts | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8968c578..1966371c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -108,6 +108,17 @@ "request": "attach", "skipFiles": ["/**"], "type": "node" + }, + { + "type": "node", + "request": "launch", + "name": "Debug Current TS File", + "runtimeExecutable": "npx", + "runtimeArgs": ["tsx", "${file}"], + "skipFiles": ["/**"], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal", + "env": {} } ], "inputs": [ diff --git a/packages/core/src/core/tokenLimits.ts b/packages/core/src/core/tokenLimits.ts index f8ed1018..5992e8f0 100644 --- a/packages/core/src/core/tokenLimits.ts +++ b/packages/core/src/core/tokenLimits.ts @@ -115,7 +115,7 @@ const PATTERNS: Array<[RegExp, TokenCount]> = [ [/^coder-model$/, LIMITS['1m']], // Commercial Qwen3-Max-Preview: 256K token context - [/^qwen3-max-preview(-.*)?$/, LIMITS['256k']], // catches "qwen3-max-preview" and date variants + [/^qwen3-max(-preview)?(-.*)?$/, LIMITS['256k']], // catches "qwen3-max" or "qwen3-max-preview" and date variants // Open-source Qwen3-Coder variants: 256K native [/^qwen3-coder-.*$/, LIMITS['256k']], @@ -179,8 +179,8 @@ const OUTPUT_PATTERNS: Array<[RegExp, TokenCount]> = [ // Generic coder-model: same as qwen3-coder-plus (64K max output tokens) [/^coder-model$/, LIMITS['64k']], - // Qwen3-Max-Preview: 65,536 max output tokens - [/^qwen3-max-preview(-.*)?$/, LIMITS['64k']], + // Qwen3-Max: 65,536 max output tokens + [/^qwen3-max(-preview)?(-.*)?$/, LIMITS['64k']], // Qwen-VL-Max-Latest: 8,192 max output tokens [/^qwen-vl-max-latest$/, LIMITS['8k']],