feat(providers): add qoder-cn support for Qoder CN (qoder.com.cn)

This commit is contained in:
Liang.Xu
2026-09-21 20:44:26 +07:00
parent f67d5a0c93
commit 402745dc1f
30 changed files with 487 additions and 234 deletions

View File

@@ -187,6 +187,7 @@
"perplexity-web": "perplexity-web",
"poolside": "poolside",
"qoder": "qd",
"qoder-cn": "qdcn",
"sambanova": "samba",
"siliconflow": "siliconflow",
"tencent": "hunyuan",
@@ -280,6 +281,7 @@
"perplexity-web",
"poolside",
"qd",
"qdcn",
"qianfan",
"recraft",
"runwayml",

View File

@@ -719,6 +719,16 @@
"validateUrl": "https://ollama.com/api/tags",
"format": "ollama"
},
"qoder-cn": {
"baseUrl": "https://gateway.qoder.com.cn/algo/api/v2/service/pro/sse/agent_chat_generation",
"headers": {},
"timeoutMs": 120000,
"stallTimeoutMs": 120000,
"usage": {
"url": "https://openapi.qoder.com.cn/api/v2/quota/usage"
},
"format": "openai"
},
"openai": {
"baseUrl": "https://api.openai.com/v1/chat/completions",
"forceStream": true,

View File

@@ -651,6 +651,11 @@ describe("qoderInferenceBase", () => {
expect(qoderInferenceBase({ accessToken: "jt-abc" })).toContain("api2.qoder.sh");
expect(qoderInferenceBase({ accessToken: "dt-abc" })).toContain("api3.qoder.sh");
});
it("serves every token kind from the CN gateway for the qoder-cn region", () => {
expect(qoderInferenceBase({ accessToken: "jt-abc" }, "cn")).toContain("gateway.qoder.com.cn");
expect(qoderInferenceBase({ accessToken: "dt-abc" }, "cn")).toContain("gateway.qoder.com.cn");
});
});
describe("rewriteQoderMessageAttachments", () => {

View File

@@ -14,7 +14,7 @@ vi.mock("../../open-sse/utils/proxyFetch.js", () => ({
const load = () => import("../../open-sse/services/usage.js");
const SUPPORTED = [
"github", "gemini-cli", "antigravity", "claude", "codex", "kiro",
"qoder", "iflow", "ollama", "glm", "glm-cn",
"qoder", "qoder-cn", "iflow", "ollama", "glm", "glm-cn",
"minimax", "minimax-cn", "vercel-ai-gateway", "grok-cli", "kimi",
"deepseek", "opencode-go", "zed", "commandcode",
];