commandcode 0.1.8: a model of the plan takes pictures as its maker's models do, not none of them (ARNO on magpie 0.1.810, Discord: command code provider 的所有模型都没有自动勾上支持图片输入) — Command Code's /provider/v1/models gives no modalities (all 86 entries, testdata/models.json and the live list read from a moved account's plugin-providers.json alike), and runtimeModel always set capabilities.input.image to !!m.images, false for every model, which magpie's plugin host reads as the plugin's answer (host.js: imageSaid when the value is a boolean) and takes over models.dev's. So every model of a moved plan, Claude, GPT-6, Kimi K3 and Qwen 3.8 included, showed no image input, where the built-in (whose list said nothing either) answered from models.dev (catalog.SeesImages). runtimeModel now says image only when m.images is a boolean; liveModels takes the list's modalities when it gives them, else the default list's answer (which now marks Claude Sonnet 5, Opus 5.5, GPT-6 Sol, Kimi K3 and MiniMax M3, as models.dev has them; DeepSeek V4 and GLM-5.3 read text alone and say nothing), else the CLI's table's (GO_MODELS, Pixel Canary among them), else true for a Claude model, and of any other says nothing, so magpie answers from models.dev as the built-in did (DeepSeek V4, GLM-5.x, MiniMax M2.x, Hy4 and the rest models.dev calls text-only stay without). A list that gives modalities is taken at its word, an explicit text-only included (the old || undefined dropped it). Go's goModels is unchanged but no longer says false for a model the table doesn't mark. models.test.mjs gains a test (a Pro account's 86 models: known image models say true, the rest leave image unsaid, a list's own modalities win, Go keeps the table's); it fails on 0.1.7 and passes. HOME=$(mktemp -d) bun test (459 pass) and bun scripts/check.mjs commandcode pass. Not tried in a real OpenCode/magpie session with the new version; magpie needs the mover's min raised to 0.1.8 for moved users to get it.

This commit is contained in:
yetone
2026-10-04 12:04:57 +08:00
parent b5fc67f0f4
commit b2ddbc5017
4 changed files with 75 additions and 10 deletions
+48
View File
@@ -81,3 +81,51 @@ test("the list's failures read as the built-in's", async () => {
expect(await fail(Response.json({ data: [] }))).toBe(`${url}: no models listed`)
expect(await fail(Response.json({ data: [{ id: "claude-opus-5-5" }, { id: "gpt-6-sol" }] }))).toBe("Command Code listed no models for the Go plan")
})
// Command Code's list says nothing of pictures, and magpie's plugin host
// takes a model whose capabilities.input.image is a boolean as the plugin's
// answer, over models.dev's (internal/plugin/host.js, imageSaid): a false
// said for every model left each one of a moved plan without image input
// (ARNO on magpie 0.1.810). A model the plugin knows takes pictures says
// so; of one it doesn't know, nothing is said, and magpie answers from
// models.dev as the built-in does.
test("a model says it takes pictures when known, and nothing when not", async () => {
const pro = { type: "api", key: "pro-key", metadata: { plan: "Pro" } }
globalThis.fetch = async (url) => {
const path = new URL(String(url)).pathname
if (path === "/alpha/billing/subscriptions") return Response.json({ success: true, data: { planId: "individual-pro-monthly", status: "active" } })
if (path === "/provider/v1/models") return new Response(list, { status: 200 })
return new Response("", { status: 404 })
}
const hooks = await CommandCodePlugin()
const ms = await hooks.provider.models({ models: {} }, { auth: pro })
expect(Object.keys(ms).length).toBe(86)
const said = (id) => ms[id].capabilities.input.image
// Claude, the default list's and the CLI's table's
for (const id of ["claude-opus-5-5", "claude-haiku-4-5-20251001", "gpt-6-sol", "gpt-6-luna", "moonshotai/Kimi-K3", "Qwen/Qwen3.8-Flash", "stealth/pixel-canary", "MiniMaxAI/MiniMax-M3"]) {
expect(said(id)).toBe(true)
expect(ms[id].capabilities.attachment).toBe(true)
}
// text alone, or not known: not said either way
for (const id of ["deepseek/deepseek-v4-pro", "zai-org/GLM-5.3", "MiniMaxAI/MiniMax-M2.7", "tencent/hy4-preview"]) {
expect(said(id)).toBeUndefined()
expect("image" in ms[id].capabilities.input).toBe(false)
}
for (const m of Object.values(ms)) expect(said(m.id) === true || said(m.id) === undefined).toBe(true)
// a list that says, is taken at its word
globalThis.fetch = async (url) => {
const path = new URL(String(url)).pathname
if (path === "/alpha/billing/subscriptions") return Response.json({ success: true, data: { planId: "individual-pro-monthly", status: "active" } })
return Response.json({ data: [{ id: "claude-opus-5-5", modalities: { input: ["text"] } }, { id: "x/seer", modalities: { input: ["text", "image"] } }] })
}
_internal.subsSeen.clear()
const said2 = await (await CommandCodePlugin()).provider.models({ models: {} }, { auth: { ...pro, key: "pro-key-2" } })
expect(said2["claude-opus-5-5"].capabilities.input.image).toBe(false)
expect(said2["x/seer"].capabilities.input.image).toBe(true)
// Go: the table's pictures, nothing said of the rest
const { ms: g } = await models(list)
expect(g["moonshotai/Kimi-K3"].capabilities.input.image).toBe(true)
expect(g["zai-org/GLM-5.2"].capabilities.input).not.toHaveProperty("image")
})