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

@ -7,7 +7,9 @@ import {
buildRealizedExecutionWorkspaceFromPersisted,
buildExplicitResumeSessionOverride,
deriveTaskKeyWithHeartbeatFallback,
extractWakeCommentIds,
formatRuntimeWorkspaceWarningLog,
mergeCoalescedContextSnapshot,
prioritizeProjectWorkspaceCandidatesForRun,
parseSessionCompactionPolicy,
resolveRuntimeSessionParamsForWorkspace,
@ -357,6 +359,32 @@ describe("deriveTaskKeyWithHeartbeatFallback", () => {
});
});
describe("comment wake batching", () => {
it("preserves ordered wake comment ids when coalescing queued follow-up wakes", () => {
const merged = mergeCoalescedContextSnapshot(
{
issueId: "issue-1",
wakeReason: "issue_commented",
wakeCommentId: "comment-1",
wakeCommentIds: ["comment-1"],
paperclipWake: {
latestCommentId: "comment-1",
},
},
{
issueId: "issue-1",
wakeReason: "issue_commented",
wakeCommentId: "comment-2",
},
);
expect(extractWakeCommentIds(merged)).toEqual(["comment-1", "comment-2"]);
expect(merged.commentId).toBe("comment-2");
expect(merged.wakeCommentId).toBe("comment-2");
expect(merged.paperclipWake).toBeUndefined();
});
});
describe("buildExplicitResumeSessionOverride", () => {
it("reuses saved task session params when they belong to the selected failed run", () => {
const result = buildExplicitResumeSessionOverride({