kylesean (#255): fast-model, balanced-model, primary-model, deepseek-v4.1-flash(-sg), gemini-3.5-flash, kimi-k3 and kimi-k2.6 carry supportsReasoning: true and reasoning.effort in /v3/config, but no reasoning.supportedEfforts, so they were listed with no levels and as not reasoning. effortsOf gives such a model low, high and max plus its own default, in order. All eight are onlyReasoning, so none gets "none". Models that list their efforts are unchanged. The fixture is WorkBuddy AI's own /v3/config read today (descriptions left out). Under a real WorkBuddy AI account, low, high and max were answered 200 with reasoning on fast-model, deepseek-v4.1-flash-sg, kimi-k3 and gemini-3.5-flash; the other four weren't tried. Run (sandbox HOME): - HOME=$(mktemp -d) bun test packages/workbuddy: 101 pass, 0 fail - bun scripts/check.mjs workbuddy: ok; git diff --check clean - Broken by hand (effortsOf back to supportedEfforts only): efforts.test goes red.
37 lines
1.7 KiB
JavaScript
37 lines
1.7 KiB
JavaScript
// plugins#255 (kylesean): eight models in WorkBuddy's /v3/config say
|
|
// supportsReasoning and a default reasoning.effort but no
|
|
// reasoning.supportedEfforts, so the plugin listed them as not reasoning.
|
|
// testdata/config-efforts.json is WorkBuddy AI's own config (2026-10-20,
|
|
// descriptions left out), cut to those models and a few beside them.
|
|
import { afterEach, expect, test } from "bun:test"
|
|
import { readFileSync } from "node:fs"
|
|
import { _internal } from "./index.mjs"
|
|
|
|
const real = globalThis.fetch
|
|
afterEach(() => (globalThis.fetch = real))
|
|
|
|
const config = readFileSync(new URL("./testdata/config-efforts.json", import.meta.url), "utf8")
|
|
|
|
async function listed() {
|
|
globalThis.fetch = async () => new Response(config)
|
|
const out = await _internal.liveModels(_internal.SITES["workbuddy-ai"], { access: "a", uid: "u" })
|
|
return Object.fromEntries(out.map((m) => [m.id, m.efforts]))
|
|
}
|
|
|
|
test("a model that says only supportsReasoning and a default takes low, high, max and its default", async () => {
|
|
const e = await listed()
|
|
expect(e["fast-model"]).toEqual(["low", "medium", "high", "max"])
|
|
expect(e["kimi-k3"]).toEqual(["low", "medium", "high", "max"])
|
|
expect(e["gemini-3.5-flash"]).toEqual(["low", "medium", "high", "max"])
|
|
expect(e["primary-model"]).toEqual(["low", "high", "max"])
|
|
expect(e["deepseek-v4.1-flash-sg"]).toEqual(["low", "high", "max"])
|
|
})
|
|
|
|
test("listed efforts are kept as they are, and a model that doesn't reason gets none", async () => {
|
|
const e = await listed()
|
|
expect(e["hy3"]).toEqual(["low", "high"])
|
|
expect(e["gpt-5.6-sol"]).toEqual(["none", "low", "medium", "high", "xhigh", "max"])
|
|
expect(e["glm-5.2"]).toEqual(["none", "high", "xhigh"])
|
|
expect(e["default-model"]).toBeUndefined()
|
|
})
|