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) +})