From 7d26b54cf502c97ca5e7a7a39f0c5bfbfefe4a00 Mon Sep 17 00:00:00 2001 From: Yuhan Lei Date: Fri, 1 May 2026 16:45:49 +0800 Subject: [PATCH 1/2] fix(harness): add prompt preamble and stop rules --- packages/opencode/src/session/prompt/pawwork.txt | 10 ++++++++++ packages/opencode/test/session/system.test.ts | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/packages/opencode/src/session/prompt/pawwork.txt b/packages/opencode/src/session/prompt/pawwork.txt index b25d4b6df..02757820e 100644 --- a/packages/opencode/src/session/prompt/pawwork.txt +++ b/packages/opencode/src/session/prompt/pawwork.txt @@ -55,8 +55,18 @@ Use the user's language. Be concise, direct, and specific. Before important actions, briefly state the next step and why it matters. After code changes, summarize what changed, where it changed, and how it was verified. +For multi-step, tool-heavy, or long-running requests, begin with a brief acknowledgment before calling tools. State only the first step, not a full plan, unless the task itself needs planning. + Do not send users to OpenCode help, OpenCode documentation, or OpenCode issue trackers as PawWork's support surface. +# Stop rules + +When the evidence is sufficient to answer the user's core request, stop and answer. Do not keep searching or calling tools only to improve phrasing, add nonessential detail, or make the answer look more complete. + +When a tool returns empty, partial, or unexpected results, try one fallback strategy, such as a broader query, alternate filter, or different tool. If that also fails, report what you tried and what is still missing. + +For irreversible or external-side-effect actions, ask for confirmation unless the user has already clearly approved that exact action in this conversation. This includes sending, publishing, deleting, deploying, committing, pushing, opening or merging pull requests, and mutating GitHub issues, pull requests, or labels. + # Safety Do not expose secrets, log credentials, or commit private keys. diff --git a/packages/opencode/test/session/system.test.ts b/packages/opencode/test/session/system.test.ts index 9a68cbc2a..56e11fa5a 100644 --- a/packages/opencode/test/session/system.test.ts +++ b/packages/opencode/test/session/system.test.ts @@ -49,6 +49,11 @@ describe("session.system", () => { expect(prompt).toContain("execute") expect(prompt).toContain("parallel") expect(prompt).toContain("dedicated file and search tools") + expect(prompt).toContain("multi-step") + expect(prompt).toContain("first step") + expect(prompt).toContain("Stop rules") + expect(prompt).toContain("one fallback") + expect(prompt).toContain("external-side-effect") expect(prompt).toContain("durable project guidance") expect(prompt).toContain("recurring background context") expect(prompt).toContain("nearest relevant AGENTS.md") From 95136a207f128d11b234de39fe15971d01918294 Mon Sep 17 00:00:00 2001 From: Yuhan Lei Date: Fri, 1 May 2026 17:31:43 +0800 Subject: [PATCH 2/2] fix(harness): consolidate prompt confirmation rules --- packages/opencode/src/session/prompt/pawwork.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/opencode/src/session/prompt/pawwork.txt b/packages/opencode/src/session/prompt/pawwork.txt index 02757820e..51caea7ff 100644 --- a/packages/opencode/src/session/prompt/pawwork.txt +++ b/packages/opencode/src/session/prompt/pawwork.txt @@ -72,5 +72,3 @@ For irreversible or external-side-effect actions, ask for confirmation unless th Do not expose secrets, log credentials, or commit private keys. Do not use destructive git commands or rewrite history unless the user explicitly asks and the target is clear. - -Do not commit, push, create pull requests, merge pull requests, or change labels unless the user clearly asks.