From 5d2621db88493eb236c979b1d2255b2abe024cd3 Mon Sep 17 00:00:00 2001 From: yetone Date: Mon, 5 Oct 2026 19:54:33 +0800 Subject: [PATCH] =?UTF-8?q?factory=200.1.17:=20DeepSeek=20V4.1=20Flash,=20?= =?UTF-8?q?Kimi=20K3=20and=20GLM-5.2=20offer=20none,=20so=20a=20request=20?= =?UTF-8?q?turning=20reasoning=20off=20stops=20their=20thinking=20(yetone/?= =?UTF-8?q?magpie#899,=20tedestar)=20=E2=80=94=20they=20offered=20only=20l?= =?UTF-8?q?ow/high/max=20(GLM-5.2=20high/max),=20so=20magpie=20asked=20for?= =?UTF-8?q?=20low=20and=20they=20thought=20anyway.=20droid=200.231.0=20lis?= =?UTF-8?q?ts=20off=20for=20them=20and=20sends=20reasoning=5Feffort=20"non?= =?UTF-8?q?e";=20Fireworks=20(via=20OpenRouter,=20pinned)=20answered=20non?= =?UTF-8?q?e=20with=200=20reasoning=20tokens=20on=20DeepSeek=20V4.1=20Flas?= =?UTF-8?q?h=20(2=20completion=20tokens,=2019=20at=20default)=20and=20Kimi?= =?UTF-8?q?=20K3=20(8,=2071=20at=20default),=20and=20turns=20none=20away?= =?UTF-8?q?=20on=20GLM-5.3=20and=20GLM-5.3-Flash=20("Reasoning=20is=20mand?= =?UTF-8?q?atory"),=20whose=20least=20stays=20low.=20effort.test.mjs=20is?= =?UTF-8?q?=20new=20(the=20levels=20fail=20on=200.1.16);=20bun=20test=20an?= =?UTF-8?q?d=20check.mjs=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/factory/README.md | 5 +++- packages/factory/effort.test.mjs | 42 ++++++++++++++++++++++++++++++++ packages/factory/index.mjs | 9 ++++--- packages/factory/package.json | 2 +- 4 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 packages/factory/effort.test.mjs diff --git a/packages/factory/README.md b/packages/factory/README.md index 94c1a9a..f32319f 100644 --- a/packages/factory/README.md +++ b/packages/factory/README.md @@ -67,7 +67,10 @@ Each model is served on the one API droid uses for it: | OpenAI Responses (`/api/llm/o/v1`) | GPT-6.1 Sol, GPT-6 Sol/Astra/Luna, GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4, GPT-5.3-Codex, Grok 4.7, Grok 4.6 | | Chat completions (`/api/llm/o/v1`) | GLM-5.3, GLM-5.3-Flash, GLM-5.2, Kimi K3, DeepSeek V4.1 Flash, Qwen3.8 Max, MiniMax M3, Mistral Medium 3.5, Nemotron 3 Ultra | -Reasoning efforts are the variants droid offers for each model. +Reasoning efforts are the variants droid offers for each model. DeepSeek V4.1 +Flash, Kimi K3 and GLM-5.2 have `none`, droid's "off": they stop thinking. +Reasoning is mandatory on GLM-5.3 and GLM-5.3-Flash (Fireworks turns `none` +away), so `low` is their least. The list is not included: diff --git a/packages/factory/effort.test.mjs b/packages/factory/effort.test.mjs new file mode 100644 index 0000000..7c9d941 --- /dev/null +++ b/packages/factory/effort.test.mjs @@ -0,0 +1,42 @@ +// yetone/magpie#899: DeepSeek V4.1 Flash, Kimi K3 (Fireworks) and GLM-5.2 +// (Baseten) stop thinking at reasoning_effort "none", droid 0.231.0's +// "off"; offered only low/high/max, a request turning reasoning off was +// asked for low, and they thought anyway. GLM-5.3 and GLM-5.3-Flash can't +// (Fireworks: "Reasoning is mandatory"): low stays their least. The cases +// are the built-in's TestFactoryThinkingOff. +import { afterEach, expect, test } from "bun:test" +import { FactoryAuthPlugin } from "./index.mjs" + +const real = globalThis.fetch +afterEach(() => (globalThis.fetch = real)) + +test("the models that can stop thinking offer none, the others don't", async () => { + const hooks = await FactoryAuthPlugin({ client: { auth: { set: async () => {} } } }) + const cfg = { provider: {} } + await hooks.config(cfg) + const levels = (id) => Object.keys(cfg.provider.factory.models[id].variants) + expect(levels("deepseek-v4.1-flash")).toEqual(["none", "low", "high", "max"]) + expect(levels("kimi-k3")).toEqual(["none", "low", "high", "max"]) + expect(levels("glm-5.2")).toEqual(["none", "high", "max"]) + expect(cfg.provider.factory.models["kimi-k3"].variants.none).toEqual({ reasoningEffort: "none" }) + for (const id of ["glm-5.3", "glm-5.3-flash", "qwen3.8-max", "minimax-m3"]) expect(levels(id)).not.toContain("none") +}) + +test("none is sent on to Factory as it was asked", async () => { + const sent = [] + globalThis.fetch = async (url, init = {}) => { + if (new URL(String(url)).pathname === "/api/cli/whoami") return new Response(JSON.stringify({ userId: "u", orgId: "fac_D", email: "d@example.com", region: "" })) + sent.push(init.body) + return new Response('{"id":"ok"}') + } + let saved = { type: "oauth", access: "tok", refresh: "r", expires: Date.now() + 3_600_000, accountId: "d@example.com", activeOrganizationId: "fac_D", region: "", premBaseHost: "" } + const hooks = await FactoryAuthPlugin({ client: { auth: { set: async ({ body }) => (saved = body) } } }) + const l = await hooks.auth.loader(async () => saved) + const res = await l.fetch("https://api.factory.ai/api/llm/o/v1/chat/completions", { + method: "POST", + headers: { "content-type": "application/json" }, + body: `{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"hi"}],"reasoning_effort":"none"}`, + }) + expect(res.status).toBe(200) + expect(JSON.parse(sent.at(-1)).reasoning_effort).toBe("none") +}) diff --git a/packages/factory/index.mjs b/packages/factory/index.mjs index 70e1482..444266d 100644 --- a/packages/factory/index.mjs +++ b/packages/factory/index.mjs @@ -58,11 +58,14 @@ const MODELS = [ ["gpt-5.3-codex", "GPT-5.3-Codex", RESPONSES, "openai", 400000, 128000, E4, true], ["grok-4.7", "Grok 4.7", RESPONSES, "xai", 500000, 63356, E4, true], ["grok-4.6", "Grok 4.6", RESPONSES, "xai", 200000, 63356, E4, true], + // reasoning is mandatory on GLM-5.3 and GLM-5.3-Flash (Fireworks turns + // none away): low is their least. GLM-5.2, Kimi K3 and DeepSeek V4.1 + // Flash stop thinking at none, droid's "off" (yetone/magpie#899). ["glm-5.3", "GLM-5.3", CHAT, "fireworks", 1040000, 131072, ["low", "high", "max"], false], ["glm-5.3-flash", "GLM-5.3-Flash", CHAT, "fireworks", 1048576, 131072, ["low", "high", "max"], true], - ["glm-5.2", "GLM-5.2", CHAT, "baseten", 1040000, 131072, ["high", "max"], false], - ["kimi-k3", "Kimi K3", CHAT, "fireworks", 262144, 65536, ["low", "high", "max"], true], - ["deepseek-v4.1-flash", "DeepSeek V4.1 Flash", CHAT, "fireworks", 1040000, 131072, ["low", "high", "max"], true], + ["glm-5.2", "GLM-5.2", CHAT, "baseten", 1040000, 131072, ["none", "high", "max"], false], + ["kimi-k3", "Kimi K3", CHAT, "fireworks", 262144, 65536, ["none", "low", "high", "max"], true], + ["deepseek-v4.1-flash", "DeepSeek V4.1 Flash", CHAT, "fireworks", 1040000, 131072, ["none", "low", "high", "max"], true], ["qwen3.8-max", "Qwen3.8 Max", CHAT, "fireworks", 262144, 131072, ["low", "medium", "xhigh"], false], ["minimax-m3", "MiniMax M3", CHAT, "fireworks", 512000, 64000, ["high"], true], ["minimax-m2.7", "MiniMax M2.7", ANTHROPIC, "fireworks", 196600, 64000, ["high"], false], diff --git a/packages/factory/package.json b/packages/factory/package.json index f39eaaf..c5e175e 100644 --- a/packages/factory/package.json +++ b/packages/factory/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/opencode-factory-auth", - "version": "0.1.16", + "version": "0.1.17", "description": "Sign in to a Factory (Droid) subscription from OpenCode or magpie", "type": "module", "main": "./index.mjs",