test(codex): sync chat preset snapshot after native Responses migration

Commit 273cc48c migrated 7 CN providers from openai_chat to native
openai_responses and refreshed model ids on the remaining chat-only
providers, but the codexChatProviderPresets snapshot was not updated,
breaking the unit tests on main.

Drop the migrated providers (DouBaoSeed, Bailian, Longcat, MiniMax,
MiniMax en, Xiaomi MiMo x2) from the chat list, sync GLM/StepFun/Ling
model ids, and add a test locking the migrated presets to
openai_responses with no modelCatalog (so the local route-mapping
toggle stays unchecked).
This commit is contained in:
Jason
2026-06-26 09:43:33 +08:00
parent 7d74d2449a
commit f8768c5885
+27 -55
View File
@@ -24,13 +24,6 @@ const expectedChatPresets = new Map<
contextWindows: { "ark-code-latest": 256000 },
},
],
[
"DouBaoSeed",
{
baseUrl: "https://ark.cn-beijing.volces.com/api/v3",
contextWindows: { "doubao-seed-2-1-pro": 256000 },
},
],
[
"DeepSeek",
{
@@ -45,14 +38,14 @@ const expectedChatPresets = new Map<
"Zhipu GLM",
{
baseUrl: "https://open.bigmodel.cn/api/coding/paas/v4",
contextWindows: { "glm-5.1": 200000 },
contextWindows: { "glm-5.2": 200000 },
},
],
[
"Zhipu GLM en",
{
baseUrl: "https://api.z.ai/api/coding/paas/v4",
contextWindows: { "glm-5.1": 200000 },
contextWindows: { "glm-5.2": 200000 },
},
],
[
@@ -62,16 +55,6 @@ const expectedChatPresets = new Map<
contextWindows: { "qianfan-code-latest": 131072 },
},
],
[
"Bailian",
{
baseUrl: "https://dashscope.aliyuncs.com/compatible-mode/v1",
contextWindows: {
"qwen3-coder-plus": 1000000,
"qwen3-max": 262144,
},
},
],
[
"Kimi",
{
@@ -84,6 +67,7 @@ const expectedChatPresets = new Map<
{
baseUrl: "https://api.stepfun.com/step_plan/v1",
contextWindows: {
"step-3.7-flash": 262144,
"step-3.5-flash-2603": 262144,
"step-3.5-flash": 262144,
},
@@ -94,6 +78,7 @@ const expectedChatPresets = new Map<
{
baseUrl: "https://api.stepfun.ai/step_plan/v1",
contextWindows: {
"step-3.7-flash": 262144,
"step-3.5-flash-2603": 262144,
"step-3.5-flash": 262144,
},
@@ -106,46 +91,11 @@ const expectedChatPresets = new Map<
contextWindows: { "ZhipuAI/GLM-5.1": 200000 },
},
],
[
"Longcat",
{
baseUrl: "https://api.longcat.chat/openai/v1",
contextWindows: { "LongCat-Flash-Chat": 262144 },
},
],
[
"MiniMax",
{
baseUrl: "https://api.minimaxi.com/v1",
contextWindows: { "MiniMax-M2.7": 200000 },
},
],
[
"MiniMax en",
{
baseUrl: "https://api.minimax.io/v1",
contextWindows: { "MiniMax-M2.7": 200000 },
},
],
[
"BaiLing",
{
baseUrl: "https://api.tbox.cn/api/llm/v1",
contextWindows: { "Ling-2.5-1T": 131072 },
},
],
[
"Xiaomi MiMo",
{
baseUrl: "https://api.xiaomimimo.com/v1",
contextWindows: { "mimo-v2.5-pro": 1048576 },
},
],
[
"Xiaomi MiMo Token Plan (China)",
{
baseUrl: "https://token-plan-cn.xiaomimimo.com/v1",
contextWindows: { "mimo-v2.5-pro": 1048576 },
contextWindows: { "Ling-2.6-1T": 262144 },
},
],
[
@@ -202,4 +152,26 @@ describe("Codex Chat provider presets", () => {
).toEqual(expected.contextWindows);
}
});
it("uses native Responses API for migrated CN providers without local route mapping", () => {
const nativeResponsesPresets = [
"DouBaoSeed",
"Bailian",
"Longcat",
"MiniMax",
"MiniMax en",
"Xiaomi MiMo",
"Xiaomi MiMo Token Plan (China)",
];
for (const name of nativeResponsesPresets) {
const preset = codexProviderPresets.find((item) => item.name === name);
expect(preset, `${name} preset`).toBeDefined();
expect(preset?.apiFormat).toBe("openai_responses");
// 原生 Responses 预设必须不带 modelCatalog,否则“本地路由映射”开关会默认勾选
expect(preset?.modelCatalog ?? []).toHaveLength(0);
expect(preset?.codexChatReasoning).toBeUndefined();
}
});
});