From 575f1e23e7a3e5f9de45875ed0da94c9289eb982 Mon Sep 17 00:00:00 2001 From: yetone Date: Fri, 23 Oct 2026 09:31:24 +0800 Subject: [PATCH] workbuddy 0.1.30: a refused line quoted back into an assistant message is reworded there too (#291) tearslee measured on 0.1.29 that the "Web GUI whose URL the runtime context names. When the user refers" line is refused as 11128 in an assistant message, where the system-prompt move can't reach it, so a long DeepSeek Harness chat stays refused for good. Its wording "... names. The interface, when the user refers" went 400 -> 200 for them. It joins FLAGGED, which unflag applies to every message, assistant ones included. The README now says the move doesn't cover an assistant message and that only a new chat clears words not in the list. Run: bun test in packages/workbuddy (sandbox HOME), 112 pass; the new test covers a string and a parts assistant message and a line break between the sentences. Not tried: the 400 itself. A short probe with the line through magpie got 200, so the refusal needs more of the chat than I have; the 400 -> 200 is tearslee's measurement. --- packages/workbuddy/README.md | 7 +++++-- packages/workbuddy/index.mjs | 5 +++++ packages/workbuddy/package.json | 2 +- packages/workbuddy/unflag.test.mjs | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/packages/workbuddy/README.md b/packages/workbuddy/README.md index e1071a5..201471b 100644 --- a/packages/workbuddy/README.md +++ b/packages/workbuddy/README.md @@ -92,8 +92,11 @@ WorkBuddy's default system prompt in its place: WorkBuddy checks only the system and assistant messages, and the line it matched is then in neither. A system message later in the chat becomes a user message where it stands. The plugin remembers each refused system prompt while it is loaded, so that -agent's next chats go moved at once. A refusal that stands after the move -(words in an assistant message) ends in a hint that names no one client +agent's next chats go moved at once. The move can't reach an assistant +message, so words the model quotes back into one keep that chat refused +until they are in the list reworded in every message (since 0.1.30, the "Web GUI whose URL the runtime +context names" line, #291); otherwise only a new chat clears it. A refusal +that stands after the move ends in a hint that names no one client (since 0.1.28): WorkBuddy refused words in this client's prompt; use it from Hermes, OpenCode or Pi, or add another provider to the group. Neither refusal rests the account. diff --git a/packages/workbuddy/index.mjs b/packages/workbuddy/index.mjs index 3cbc9df..a48aa4e 100644 --- a/packages/workbuddy/index.mjs +++ b/packages/workbuddy/index.mjs @@ -467,6 +467,11 @@ const FLAGGED = [ // 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."], + // 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 + // the user's instructions can't reach, so it is reworded in every message. + [/Web GUI whose URL the runtime context names\.\s+When the user refers/gi, "Web GUI whose URL the runtime context names. The interface, when the user refers"], ] function unflagged(text) { diff --git a/packages/workbuddy/package.json b/packages/workbuddy/package.json index db08278..7752de5 100644 --- a/packages/workbuddy/package.json +++ b/packages/workbuddy/package.json @@ -1,6 +1,6 @@ { "name": "@magpie-community/opencode-workbuddy-auth", - "version": "0.1.29", + "version": "0.1.30", "description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)", "type": "module", "main": "./index.mjs", diff --git a/packages/workbuddy/unflag.test.mjs b/packages/workbuddy/unflag.test.mjs index affdf42..f24eebe 100644 --- a/packages/workbuddy/unflag.test.mjs +++ b/packages/workbuddy/unflag.test.mjs @@ -51,3 +51,21 @@ test("a chat with nothing flagged is sent as it came", () => { const body = JSON.stringify({ messages: [{ role: "system", content: "be brief" }, { role: "user", content: "hi" }] }) expect(withSystem(body)).toBe(body) }) + +test("a refused line quoted back into an assistant message is reworded there too (#291)", () => { + const line = "There is a Web GUI whose URL the runtime context names. When the user refers to it, open it." + const fixed = "There is a Web GUI whose URL the runtime context names. The interface, when the user refers to it, open it." + expect(unflagged(line)).toBe(fixed) + expect(unflagged(line.replace(". When", ".\nWhen"))).toBe(fixed) + expect(unflagged(fixed)).toBe(fixed) + const body = JSON.stringify({ messages: [ + { role: "system", content: "be brief" }, + { role: "user", content: "hi" }, + { role: "assistant", content: line }, + { role: "assistant", content: [{ type: "text", text: line }] }, + { role: "user", content: "go on" }, + ] }) + const b = JSON.parse(withSystem(body)) + expect(b.messages[2].content).toBe(fixed) + expect(b.messages[3].content[0].text).toBe(fixed) +})