From a251a535712f2cce61153dc638d3271a3c0a7692 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 7 Mar 2026 09:52:01 -0600 Subject: [PATCH] fix(openclaw): embed explicit heartbeat workflow in wake text Include the full Paperclip API workflow (checkout, fetch, update) and endpoint bans in the wake text sent to OpenClaw agents, preventing them from guessing non-existent endpoints. Applied to both openclaw and openclaw_gateway adapters. Co-Authored-By: Claude Opus 4.6 --- .../openclaw-gateway/src/server/execute.ts | 35 +++++++++++++++++-- .../openclaw/src/server/execute-common.ts | 35 +++++++++++++++++-- 2 files changed, 66 insertions(+), 4 deletions(-) diff --git a/packages/adapters/openclaw-gateway/src/server/execute.ts b/packages/adapters/openclaw-gateway/src/server/execute.ts index 3cc20533..407e455b 100644 --- a/packages/adapters/openclaw-gateway/src/server/execute.ts +++ b/packages/adapters/openclaw-gateway/src/server/execute.ts @@ -328,15 +328,21 @@ function buildWakeText(payload: WakePayload, paperclipEnv: Record"; + const lines = [ "Paperclip wake event for a cloud adapter.", "", + "Run this procedure now. Do not guess undocumented endpoints and do not ask for additional heartbeat docs.", + "", "Set these values in your run context:", ...envLines, `PAPERCLIP_API_KEY=`, "", `Load PAPERCLIP_API_KEY from ${claimedApiKeyPath} (the token you saved after claim-api-key).`, "", + `api_base=${apiBaseHint}`, `task_id=${payload.taskId ?? ""}`, `issue_id=${payload.issueId ?? ""}`, `wake_reason=${payload.wakeReason ?? ""}`, @@ -344,9 +350,34 @@ function buildWakeText(payload: WakePayload, paperclipEnv: Record"; + const lines = [ "Paperclip wake event for a cloud adapter.", "", + "Run this procedure now. Do not guess undocumented endpoints and do not ask for additional heartbeat docs.", + "", "Set these values in your run context:", ...envLines, `PAPERCLIP_API_KEY=`, "", `Load PAPERCLIP_API_KEY from ${claimedApiKeyPath} (the token you saved after claim-api-key).`, "", + `api_base=${apiBaseHint}`, `task_id=${payload.taskId ?? ""}`, `issue_id=${payload.issueId ?? ""}`, `wake_reason=${payload.wakeReason ?? ""}`, @@ -306,9 +312,34 @@ export function buildWakeText(payload: WakePayload, paperclipEnv: Record