The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
openclaw: preserve run metadata in wake compatibility payload
Dottaa0e6ad0b7dd6
diff --git a/packages/adapters/openclaw/src/server/execute.ts b/packages/adapters/openclaw/src/server/execute.tsindex a1e17a3488..5492bfbda8 100644--- a/packages/adapters/openclaw/src/server/execute.ts+++ b/packages/adapters/openclaw/src/server/execute.ts@@ -439,6 +439,13 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExecconst wakeTextBody = {text: buildWakeText(wakePayload),mode: "now",+ sessionKey,+ paperclip: {+ ...wakePayload,+ sessionKey,+ streamTransport: transport,+ context,+ },};if (onMeta) {diff --git a/server/src/__tests__/openclaw-adapter.test.ts b/server/src/__tests__/openclaw-adapter.test.tsindex 3133fccf2b..bf5bb7e288 100644--- a/server/src/__tests__/openclaw-adapter.test.ts+++ b/server/src/__tests__/openclaw-adapter.test.ts@@ -158,6 +158,8 @@ describe("openclaw adapter execute", () => {const body = JSON.parse(String(fetchMock.mock.calls[0]?.[1]?.body ?? "{}")) as Record<string, unknown>;expect(body.mode).toBe("now");expect(typeof body.text).toBe("string");+ expect(body.paperclip).toBeTypeOf("object");+ expect((body.paperclip as Record<string, unknown>).runId).toBe("run-123");expect(result.resultJson?.compatibilityMode).toBe("wake_text");expect(result.resultJson?.transportFallback).toBe("webhook");});@@ -181,7 +183,8 @@ describe("openclaw adapter execute", () => {const body = JSON.parse(String(fetchMock.mock.calls[0]?.[1]?.body ?? "{}")) as Record<string, unknown>;expect(body.mode).toBe("now");expect(typeof body.text).toBe("string");- expect(body.paperclip).toBeUndefined();+ expect(body.paperclip).toBeTypeOf("object");+ expect((body.paperclip as Record<string, unknown>).runId).toBe("run-123");});it("retries with wake text payload when endpoint reports text required in webhook mode", async () => {@@ -215,6 +218,8 @@ describe("openclaw adapter execute", () => {const secondBody = JSON.parse(String(fetchMock.mock.calls[1]?.[1]?.body ?? "{}")) as Record<string, unknown>;expect(secondBody.mode).toBe("now");expect(typeof secondBody.text).toBe("string");+ expect(secondBody.paperclip).toBeTypeOf("object");+ expect((secondBody.paperclip as Record<string, unknown>).runId).toBe("run-123");expect(result.resultJson?.compatibilityMode).toBe("wake_text");});});