Auto-checkout scoped issue wakes in the harness

This commit is contained in:
Dotta 2026-04-11 10:53:28 -05:00
parent b649bd454f
commit c1bb938519
5 changed files with 107 additions and 25 deletions

View file

@ -568,9 +568,10 @@ describe("codex execute", () => {
id: "issue-1",
identifier: "PAP-1201",
title: "Fix gallery opening for inline images",
status: "todo",
status: "in_progress",
priority: "medium",
},
checkedOutByHarness: true,
commentIds: [],
latestCommentId: null,
comments: [],
@ -598,16 +599,19 @@ describe("codex execute", () => {
issue: {
identifier: "PAP-1201",
title: "Fix gallery opening for inline images",
status: "todo",
status: "in_progress",
priority: "medium",
},
checkedOutByHarness: true,
commentIds: [],
});
expect(capture.prompt).toContain("## Paperclip Wake Payload");
expect(capture.prompt).toContain("Do not switch to another issue until you have handled this wake.");
expect(capture.prompt).toContain("- issue: PAP-1201 Fix gallery opening for inline images");
expect(capture.prompt).toContain("- pending comments: 0/0");
expect(capture.prompt).toContain("- issue status: todo");
expect(capture.prompt).toContain("- issue status: in_progress");
expect(capture.prompt).toContain("- checkout: already claimed by the harness for this run");
expect(capture.prompt).toContain("The harness already checked out this issue for the current run.");
} finally {
if (previousHome === undefined) delete process.env.HOME;
else process.env.HOME = previousHome;

View file

@ -496,15 +496,34 @@ describe("heartbeat comment wake batching", () => {
id: issueId,
identifier: `${issuePrefix}-1`,
title: "Require a comment",
status: "todo",
status: "in_progress",
priority: "medium",
},
checkedOutByHarness: true,
commentIds: [],
},
});
expect(String(firstPayload.message ?? "")).toContain("## Paperclip Wake Payload");
expect(String(firstPayload.message ?? "")).toContain("Do not switch to another issue until you have handled this wake.");
expect(String(firstPayload.message ?? "")).toContain("- checkout: already claimed by the harness for this run");
expect(String(firstPayload.message ?? "")).toContain(
"The harness already checked out this issue for the current run.",
);
expect(String(firstPayload.message ?? "")).toContain(`${issuePrefix}-1 Require a comment`);
const checkedOutIssue = await db
.select({
status: issues.status,
checkoutRunId: issues.checkoutRunId,
executionRunId: issues.executionRunId,
})
.from(issues)
.where(eq(issues.id, issueId))
.then((rows) => rows[0] ?? null);
expect(checkedOutIssue).toMatchObject({
status: "in_progress",
checkoutRunId: firstRun?.id,
executionRunId: firstRun?.id,
});
gateway.releaseFirstWait();
await waitFor(async () => {
const runs = await db