From 79b02cc5682b01eeefc50e616f13453e8347719c Mon Sep 17 00:00:00 2001 From: MYCF711 <1451895195@qq.com> Date: Fri, 30 Oct 2026 14:30:38 +0800 Subject: [PATCH] workbuddy 0.2.2: DeepSeek Harness's opener keeps the harness's name (#511) WorkBuddy refuses DeepSeek Harness's opener "You are an AI agent powered by DeepSeek Harness." as 11128 (#279). The plugin used to reword it into "You are an AI agent that helps the user with programming tasks.", which dropped the harness's name from the line the rest of a DSH prompt refers back to. It now adds one comma ("You are an AI agent, powered by DeepSeek Harness."), which the author measured passing WorkBuddy's whole-line check (400 11128 without the comma, 200 with it, copilot.tencent.com, 2026-10-30). Run at the reviewed head 4830b16, merged onto main 7673cd0 (a fast-forward), on mote (macOS, Bun 1.4.2) with HOME=$(mktemp -d): - packages/workbuddy `bun test`: 257 pass, 0 fail - `bun scripts/check.mjs workbuddy`: ok - `npm pack --dry-run`: magpie-community-opencode-workbuddy-auth-0.2.2.tgz, 3 files - Broken by hand: put the old rewording back in index.mjs, and both unflag tests went red (2 fail). - Real request: the comma line sent to workbuddy-ai/deepseek-v4.1-flash through a live magpie gateway (0.2.1, which leaves the comma line as written) came back 200, and the model answered "I'm running in the DeepSeek Harness." - Version: npm has 0.2.1 and this PR ships 0.2.2. Not tried: the China WorkBuddy site, because the review account's desktop sign-in answers 401 there. That 400/200 pair is the author's measurement. --- packages/workbuddy/index.mjs | 10 ++++++++-- packages/workbuddy/package.json | 2 +- packages/workbuddy/unflag.test.mjs | 16 ++++++++++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/packages/workbuddy/index.mjs b/packages/workbuddy/index.mjs index 89b5fa4..344333b 100644 --- a/packages/workbuddy/index.mjs +++ b/packages/workbuddy/index.mjs @@ -819,8 +819,14 @@ const FLAGGED = [ [/(? { expect(unflagged(unflagged(codex))).toBe(unflagged(codex)) expect(unflagged("x-anthropic-billing-header: cc_version=2.1.280.31f; cc_entrypoint=sdk-cli;\nhello")).toBe("hello") expect(unflagged("nothing to see")).toBe("nothing to see") - expect(unflagged("You are an AI agent powered by DeepSeek Harness. Be brief.")).toBe("You are an AI agent that helps the user with programming tasks. Be brief.") - expect(unflagged("YOU ARE AN AI AGENT POWERED BY DEEPSEEK HARNESS")).toBe("You are an AI agent that helps the user with programming tasks.") + expect(unflagged("You are an AI agent powered by DeepSeek Harness. Be brief.")).toBe("You are an AI agent, powered by DeepSeek Harness. Be brief.") + expect(unflagged("YOU ARE AN AI AGENT POWERED BY DEEPSEEK HARNESS")).toBe("You are an AI agent, powered by DeepSeek Harness.") +}) + +// The opener says which harness the agent runs in, and the rest of a DSH +// prompt leans on that name. It is put in other words only as far as +// WorkBuddy's whole-line match needs, so the name stays. +test("DeepSeek Harness's opener keeps the harness's name", () => { + const opener = "You are an AI agent powered by DeepSeek Harness." + const spread = unflagged(opener) + expect(spread).toBe("You are an AI agent, powered by DeepSeek Harness.") + expect(spread).toContain("DeepSeek Harness") + expect(spread).not.toBe(opener) + expect(unflagged(spread)).toBe(spread) }) test("Claude Code's request through magpie passes: header block gone, the rest rewritten", () => {