factory 0.1.17: DeepSeek V4.1 Flash, Kimi K3 and GLM-5.2 offer none, so a request turning reasoning off stops their thinking (yetone/magpie#899, tedestar) — they offered only low/high/max (GLM-5.2 high/max), so magpie asked for low and they thought anyway. droid 0.231.0 lists off for them and sends reasoning_effort "none"; Fireworks (via OpenRouter, pinned) answered none with 0 reasoning tokens on DeepSeek V4.1 Flash (2 completion tokens, 19 at default) and Kimi K3 (8, 71 at default), and turns none away on GLM-5.3 and GLM-5.3-Flash ("Reasoning is mandatory"), whose least stays low. effort.test.mjs is new (the levels fail on 0.1.16); bun test and check.mjs pass.
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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")
|
||||
})
|
||||
@@ -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],
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user