diff --git a/packages/workbuddy/README.md b/packages/workbuddy/README.md index 040c7cd..4d6767a 100644 --- a/packages/workbuddy/README.md +++ b/packages/workbuddy/README.md @@ -260,7 +260,9 @@ through as it came. When you are signed in, the models are the ones WorkBuddy's product config gives its CLI agent (`GET /v3/config`), with their context, image input and reasoning levels. Until then, or if WorkBuddy doesn't answer, the list below -is used. +is used. Since 0.2.9 its models take images, as the config says of every +model, except WorkBuddy AI's GLM models, whose images WorkBuddy AI drops +(#572). `workbuddy`: - Auto diff --git a/packages/workbuddy/declared-images.test.mjs b/packages/workbuddy/declared-images.test.mjs new file mode 100644 index 0000000..4ddf9af --- /dev/null +++ b/packages/workbuddy/declared-images.test.mjs @@ -0,0 +1,30 @@ +// plugins#572 (kongbai01203): WorkBuddy AI's kimi-k3 read as image: false +// and reasoning: false, the list the plugin declares before an account's +// own is read. That list said no model took images, while both sites' +// /v3/config mark every one supportsImages (read 2026-11-01), and a chat to +// www.workbuddy.ai's kimi-k3 with a blue|yellow PNG answered "Blue yellow". +// Only WorkBuddy AI's GLM models drop images (textOnly). +import { expect, test } from "bun:test" +import { WorkBuddyAIAuthPlugin, _internal } from "./index.mjs" + +test("a declared model takes images unless its site drops them", () => { + const ai = _internal.configModels(_internal.SITES["workbuddy-ai"]) + expect(ai["kimi-k3"].modalities.input).toEqual(["text", "image"]) + expect(ai["kimi-k3"].attachment).toBe(true) + expect(ai["glm-5.3"].modalities.input).toEqual(["text"]) + expect(ai["glm-5.3"].attachment).toBe(false) + for (const site of ["workbuddy", "workbuddy-ai"]) { + for (const [id, m] of Object.entries(_internal.configModels(_internal.SITES[site]))) { + const img = !(site === "workbuddy-ai" && id.startsWith("glm-")) + expect([site, id, m.modalities.input.includes("image")]).toEqual([site, id, img]) + } + } +}) + +test("the config hook declares kimi-k3 with images", async () => { + const h = await WorkBuddyAIAuthPlugin({ client: {} }) + const cfg = {} + await h.config(cfg) + const m = cfg.provider["workbuddy-ai"].models["kimi-k3"] + expect(m.modalities.input).toContain("image") +}) diff --git a/packages/workbuddy/index.mjs b/packages/workbuddy/index.mjs index c68cbc3..8338351 100644 --- a/packages/workbuddy/index.mjs +++ b/packages/workbuddy/index.mjs @@ -2949,11 +2949,19 @@ function variants(efforts) { // configModels is the site's own list as a provider's models, each on the // API it is served on: a Claude model on Messages, the rest on chat. +// A model declared here (before an account's list is read, for a key +// whose CLI reads no config, or when /v3/config can't be read) takes images +// unless textOnly says the site drops them: both sites' configs mark every +// model supportsImages (read 2026-11-01), and a chat to WorkBuddy AI's +// kimi-k3 with a two-colour PNG named both colours (plugins#572). Declared +// text-only, as before, every model read as one that can't see. function configModels(site) { return Object.fromEntries(site.models.map(([id, name, context, efforts]) => [id, { name, limit: { context, output: 0 }, tool_call: true, + attachment: !textOnly(site, id), + modalities: { input: textOnly(site, id) ? ["text"] : ["text", "image"], output: ["text"] }, // OpenCode (and magpie's host) read a config model's package and URL // from provider: { npm, api }, not api ...(nativeOf(site, id) ? { provider: { npm: NPM_MESSAGES, api: apiMessages(site) } } : {}), diff --git a/packages/workbuddy/package.json b/packages/workbuddy/package.json index 3a12d36..882a47c 100644 --- a/packages/workbuddy/package.json +++ b/packages/workbuddy/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/opencode-workbuddy-auth", - "version": "0.2.8", + "version": "0.2.9", "description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)", "type": "module", "main": "./index.mjs",