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.
This commit is contained in:
@@ -819,8 +819,14 @@ const FLAGGED = [
|
||||
[/(?<!the )Codex CLI is an open source project led by OpenAI\./gi, "The Codex CLI is an open source project led by OpenAI."],
|
||||
// DeepSeek Harness (DSH) opens its system prompt with this line, which
|
||||
// WorkBuddy refuses as 11128 (magpie-community/plugins#279; the same
|
||||
// refusal traced in smart-open/TraeWorkAssistant#125).
|
||||
[/You are an AI agent powered by DeepSeek Harness\.?/gi, "You are an AI agent that helps the user with programming tasks."],
|
||||
// refusal traced in smart-open/TraeWorkAssistant#125). WorkBuddy matches
|
||||
// the line whole and exactly, so a comma is enough to pass: measured on
|
||||
// 2026-10-30 against copilot.tencent.com, one account, streamed, the line
|
||||
// as DSH writes it answered 400 code 11128 and the same line with the
|
||||
// comma answered 200. Saying it in another agent's terms passed too, but
|
||||
// took the harness's own name out of the only line that says which agent
|
||||
// runs here, and that name is what the rest of the prompt refers back to.
|
||||
[/You are an AI agent powered by DeepSeek Harness\.?/gi, "You are an AI agent, powered by DeepSeek Harness."],
|
||||
// A line WorkBuddy refuses in a long DeepSeek Harness chat, measured 400
|
||||
// then 200 with this wording by tearslee (magpie-community/plugins#291). The
|
||||
// model can quote it back into an assistant message, which the move to
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@magpie-community/opencode-workbuddy-auth",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
|
||||
"type": "module",
|
||||
"main": "./index.mjs",
|
||||
|
||||
@@ -15,8 +15,20 @@ test("each flagged phrase is put in other words, whatever its case", () => {
|
||||
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", () => {
|
||||
|
||||
Reference in New Issue
Block a user