Batch inline comment wake payloads

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta 2026-03-28 09:55:41 -05:00
parent e75960f284
commit 91e040a696
14 changed files with 1049 additions and 9 deletions

View file

@ -439,6 +439,43 @@ describe("openclaw gateway adapter execute", () => {
lifecycle: "ephemeral",
},
],
paperclipWake: {
reason: "issue_commented",
issue: {
id: "issue-123",
identifier: "PAP-874",
title: "chat-speed issues",
status: "in_progress",
priority: "medium",
},
commentIds: ["comment-1", "comment-2"],
latestCommentId: "comment-2",
comments: [
{
id: "comment-1",
issueId: "issue-123",
body: "First comment",
bodyTruncated: false,
createdAt: "2026-03-28T14:35:00.000Z",
author: { type: "user", id: "user-1" },
},
{
id: "comment-2",
issueId: "issue-123",
body: "Second comment",
bodyTruncated: false,
createdAt: "2026-03-28T14:35:10.000Z",
author: { type: "user", id: "user-1" },
},
],
commentWindow: {
requestedCount: 2,
includedCount: 2,
missingCount: 0,
},
truncated: false,
fallbackFetchNeeded: false,
},
},
},
),
@ -456,6 +493,15 @@ describe("openclaw gateway adapter execute", () => {
expect(String(payload?.message ?? "")).toContain("wake now");
expect(String(payload?.message ?? "")).toContain("PAPERCLIP_RUN_ID=run-123");
expect(String(payload?.message ?? "")).toContain("PAPERCLIP_TASK_ID=task-123");
expect(String(payload?.message ?? "")).toContain("## Paperclip Wake Payload");
expect(String(payload?.message ?? "")).toContain("First comment");
expect(String(payload?.message ?? "")).toContain("\"commentIds\":[\"comment-1\",\"comment-2\"]");
expect(payload?.paperclip).toMatchObject({
wake: {
latestCommentId: "comment-2",
commentIds: ["comment-1", "comment-2"],
},
});
expect(logs.some((entry) => entry.includes("[openclaw-gateway:event] run=run-123 stream=assistant"))).toBe(true);
} finally {