mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix(codex): reject web_search for Qwen3-Coder and correct LongCat context window
- Add `qwen3-coder` to the web_search reject model-prefix blacklist so the native qwen3-coder-plus direct-connect preset suppresses the built-in tool (百炼 rejects it for the coder series), while general Qwen models sharing the DashScope host keep web_search enabled. Matched on the model axis, not host. - Correct LongCat-2.0-Preview context window from 128K to its real 1M (1048576), aligning with the MiMo/Qwen 2^20 convention. - Tighten native Responses preset tests to assert exact model→contextWindow catalogs instead of only checking catalog presence.
This commit is contained in:
@@ -154,17 +154,36 @@ describe("Codex Chat provider presets", () => {
|
||||
});
|
||||
|
||||
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)",
|
||||
];
|
||||
const nativeResponsesPresets = new Map<
|
||||
string,
|
||||
{ contextWindows: Record<string, number> }
|
||||
>([
|
||||
["DouBaoSeed", { contextWindows: { "doubao-seed-2-1-pro": 262144 } }],
|
||||
["Bailian", { contextWindows: { "qwen3-coder-plus": 1048576 } }],
|
||||
["Longcat", { contextWindows: { "LongCat-2.0-Preview": 1048576 } }],
|
||||
["MiniMax", { contextWindows: { "MiniMax-M3": 1000000 } }],
|
||||
["MiniMax en", { contextWindows: { "MiniMax-M3": 1000000 } }],
|
||||
[
|
||||
"Xiaomi MiMo",
|
||||
{
|
||||
contextWindows: {
|
||||
"mimo-v2.5-pro": 1048576,
|
||||
"mimo-v2.5": 1048576,
|
||||
},
|
||||
},
|
||||
],
|
||||
[
|
||||
"Xiaomi MiMo Token Plan (China)",
|
||||
{
|
||||
contextWindows: {
|
||||
"mimo-v2.5-pro": 1048576,
|
||||
"mimo-v2.5": 1048576,
|
||||
},
|
||||
},
|
||||
],
|
||||
]);
|
||||
|
||||
for (const name of nativeResponsesPresets) {
|
||||
for (const [name, expected] of nativeResponsesPresets) {
|
||||
const preset = codexProviderPresets.find((item) => item.name === name);
|
||||
|
||||
expect(preset, `${name} preset`).toBeDefined();
|
||||
@@ -174,6 +193,14 @@ describe("Codex Chat provider presets", () => {
|
||||
// apply_patch)。带 catalog 不再强制开“本地路由映射”——前端已按
|
||||
// apiFormat 解耦(openai_responses 默认不开接管)。
|
||||
expect((preset?.modelCatalog ?? []).length).toBeGreaterThan(0);
|
||||
expect(
|
||||
Object.fromEntries(
|
||||
(preset?.modelCatalog ?? []).map((model) => [
|
||||
model.model,
|
||||
model.contextWindow,
|
||||
]),
|
||||
),
|
||||
).toEqual(expected.contextWindows);
|
||||
// 原生(直连)不走 Chat 转换,因此不需要 codexChatReasoning。
|
||||
expect(preset?.codexChatReasoning).toBeUndefined();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user