trae 0.1.12: a reply limit Trae doesn't give is none, not a made-up 32K, and a request asking more than Trae's is held to it (ARNO on magpie's Discord: Trae CN's deepseek-v4.1-flash said maxTokens 32000) — a model whose list names no __dev max_tokens (deepseek-v4.1-flash in chat_v3, kimi-k2.6, the fallback list's) was given MODEL's 32_000, which agents were told as its reply limit. It is now 0, which magpie reads as unknown and fills from models.dev (DeepSeek V4.1 Flash's 384K); one Trae gives (glm-5.2__dev's 32000, deepseek-v4.1-flash__dev's 64000 in solo_agent) is kept, and a request asking more than it is sent with Trae's. The new test fails on 0.1.11; bun test (35 pass) and bun scripts/check.mjs trae under a temp HOME pass. Not tried with a real Trae CN account (none here).

This commit is contained in:
yetone
2026-10-05 04:29:12 +08:00
parent 20cd6f1bb2
commit c172d93901
3 changed files with 46 additions and 9 deletions
+32
View File
@@ -211,3 +211,35 @@ test("a model chat_v3 gives another's name is named and asked as SOLO lists it (
// named alike everywhere: kept on chat_v3, as before
expect(await ask("DeepSeek-V4-Flash-Official")).toBe("chat_v3 DeepSeek-V4-Flash-Official__dev")
})
// ARNO on magpie's Discord: Trae CN's DeepSeek V4.1 Flash said a 32K reply
// limit, one Trae never gave: a model whose list names no max_tokens says
// none (0), and magpie tells agents models.dev's. One Trae gives is kept,
// and a request asking more than it is held to it.
test("a reply limit is Trae's own or none, and a request is held to Trae's", async () => {
f = fakeTrae()
f.route("POST /api/ide/v1/batch_get_detail_param", () => json({ function_configs: [
{ function: "chat_v3", config_info_list: [
{ config_name: "glm-5.2", usage: "chat_completion", model_detail_list: [{ model_name: "glm-5.2__dev", max_tokens: 32000 }] },
{ config_name: "deepseek-v4.1-flash", usage: "chat_completion", context_window_tokens: { dev: 200000 }, model_detail_list: [{ model_name: "deepseek-v4.1-flash__dev" }] },
{ config_name: "kimi-k2.6", usage: "chat_completion" },
] },
] }))
f.route("POST /api/agent/v3/llm_utils_chat", (r) => sse([["output", { response: String(r.json.max_tokens) }], ["done", {}]]))
const hooks = await TraeCNAuthPlugin({ client: {} })
const p = await given(hooks)
expect(p.models["kimi-k2.6"].limit.output).toBe(0)
expect(p.models["DeepSeek-V4-Flash"].limit.output).toBe(0)
const live = await hooks.provider.models(p, { auth: signedIn() })
expect(live["glm-5.2"].limit.output).toBe(32000)
expect(live["deepseek-v4.1-flash"].limit).toEqual({ context: 200000, output: 0 })
expect(live["kimi-k2.6"].limit.output).toBe(0)
const opts = await hooks.auth.loader(async () => signedIn())
const ask = async (model, max_tokens) => {
const res = await opts.fetch(opts.baseURL + "/chat/completions", { method: "POST", body: JSON.stringify({ model, max_tokens, messages: [{ role: "user", content: "hi" }] }) })
return (await res.json()).choices[0].message.content
}
expect(await ask("glm-5.2", 131072)).toBe("32000")
expect(await ask("glm-5.2", 8000)).toBe("8000")
expect(await ask("deepseek-v4.1-flash", 384000)).toBe("384000")
})