diff --git a/packages/adapter-utils/src/server-utils.ts b/packages/adapter-utils/src/server-utils.ts index 1d84f776dbd..f486f675a9a 100644 --- a/packages/adapter-utils/src/server-utils.ts +++ b/packages/adapter-utils/src/server-utils.ts @@ -302,10 +302,11 @@ export function renderPaperclipWakePrompt( const resumedSession = options.resumedSession === true; const lines = resumedSession - ? [ + ? [ "## Paperclip Resume Delta", "", "You are resuming an existing Paperclip session.", + "This heartbeat is scoped to the issue below. Do not switch to another issue until you have handled this wake.", "Focus on the new wake delta below and continue the current task without restating the full heartbeat boilerplate.", "Fetch the API thread only when `fallbackFetchNeeded` is true or you need broader history than this batch.", "", @@ -319,6 +320,7 @@ export function renderPaperclipWakePrompt( "## Paperclip Wake Payload", "", "Treat this wake payload as the highest-priority change for the current heartbeat.", + "This heartbeat is scoped to the issue below. Do not switch to another issue until you have handled this wake.", "Before generic repo exploration or boilerplate heartbeat updates, acknowledge the latest comment and explain how it changes your next action.", "Use this inline wake data first before refetching the issue thread.", "Only fetch the API thread when `fallbackFetchNeeded` is true or you need broader history than this batch.", diff --git a/server/src/__tests__/codex-local-execute.test.ts b/server/src/__tests__/codex-local-execute.test.ts index 8c6d80f7a93..da64836774d 100644 --- a/server/src/__tests__/codex-local-execute.test.ts +++ b/server/src/__tests__/codex-local-execute.test.ts @@ -356,6 +356,7 @@ describe("codex execute", () => { }); expect(capture.prompt).toContain("## Paperclip Wake Payload"); expect(capture.prompt).toContain("Treat this wake payload as the highest-priority change for the current heartbeat."); + expect(capture.prompt).toContain("Do not switch to another issue until you have handled this wake."); expect(capture.prompt).toContain( "acknowledge the latest comment and explain how it changes your next action.", ); @@ -462,6 +463,7 @@ describe("codex execute", () => { const capture = JSON.parse(await fs.readFile(capturePath, "utf8")) as CapturePayload; expect(capture.argv).toEqual(expect.arrayContaining(["resume", "codex-session-1", "-"])); expect(capture.prompt).toContain("## Paperclip Resume Delta"); + expect(capture.prompt).toContain("Do not switch to another issue until you have handled this wake."); expect(capture.prompt).toContain("Second comment"); expect(capture.prompt).not.toContain("Follow the paperclip heartbeat."); expect(capture.prompt).not.toContain("You are managed instructions."); diff --git a/server/src/__tests__/gemini-local-execute.test.ts b/server/src/__tests__/gemini-local-execute.test.ts index d8b1cb9c195..93a4aadd299 100644 --- a/server/src/__tests__/gemini-local-execute.test.ts +++ b/server/src/__tests__/gemini-local-execute.test.ts @@ -253,6 +253,7 @@ describe("gemini execute", () => { expect(capture.argv).toContain("--resume"); expect(capture.argv).toContain("gemini-session-1"); expect(promptArg).toContain("## Paperclip Resume Delta"); + expect(promptArg).toContain("Do not switch to another issue until you have handled this wake."); expect(promptArg).toContain("Second comment"); expect(promptArg).not.toContain("Follow the paperclip heartbeat."); } finally { diff --git a/server/src/__tests__/openclaw-gateway-adapter.test.ts b/server/src/__tests__/openclaw-gateway-adapter.test.ts index e4ca99a5246..9bb85b7cdd1 100644 --- a/server/src/__tests__/openclaw-gateway-adapter.test.ts +++ b/server/src/__tests__/openclaw-gateway-adapter.test.ts @@ -497,6 +497,9 @@ describe("openclaw gateway adapter execute", () => { expect(String(payload?.message ?? "")).toContain( "Treat this wake payload as the highest-priority change for the current heartbeat.", ); + expect(String(payload?.message ?? "")).toContain( + "Do not switch to another issue until you have handled this wake.", + ); expect(String(payload?.message ?? "")).toContain("First comment"); expect(String(payload?.message ?? "")).toContain("\"commentIds\":[\"comment-1\",\"comment-2\"]"); expect(payload?.paperclip).toMatchObject({