fix: Qwen Bad Request 400 (#12067) (#12083)

This commit is contained in:
Ronald 2026-04-09 03:04:45 +06:30 committed by GitHub
parent 5b93bc7dc3
commit 92a1be40df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -69,6 +69,12 @@ export class QwenCodeHandler extends BaseProvider implements SingleCompletionHan
this.client = new OpenAI({
apiKey: "dummy-key-will-be-replaced",
baseURL: "https://dashscope.aliyuncs.com/compatible-mode/v1",
defaultHeaders: {
"User-Agent": `QwenCode/1.0.0 (${os.platform()}; ${os.arch()})`,
"X-DashScope-CacheControl": "enable",
"X-DashScope-UserAgent": `QwenCode/1.0.0 (${os.platform()}; ${os.arch()})`,
"X-DashScope-AuthType": "qwen-oauth",
},
})
}
return this.client