mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-05 06:03:51 +01:00
test(native-runtime): cite a saved request in the human-owned blocker corpus case (#23853)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
153b48dea9
commit
3ecc2dffff
1 file changed
+14
-5
@@ -3414,26 +3414,35 @@ describe("P6-31 Section 18.13 executable status-authority corpus", () => {
|
||||
expect(wakes.filter((wake) => (wake.payload as Record<string, unknown> | null)?.issueId === seeded.issueId && wake.agentId === delegateAgentId)).toHaveLength(0);
|
||||
}, 30_000);
|
||||
|
||||
it("keeps accepting a human-owned task-wide blocker without reassigning the task", async () => {
|
||||
it("accepts a human-owned task-wide blocker that cites a saved request without reassigning the task", async () => {
|
||||
const seeded = await seedFixture({ ...corpus.fixtures.find((fixture) => fixture.id === "real-task-wide-blocker")!, id: `human-blocker-owner-${randomUUID()}` });
|
||||
const [stored] = await db.select().from(nativeRunResults).where(eq(nativeRunResults.id, seeded.resultId!));
|
||||
const result = stored!.resultJson.result as { completionClaim: Record<string, unknown> };
|
||||
const named = {
|
||||
const blocked = {
|
||||
...result,
|
||||
reportedWorkDisposition: "blocked",
|
||||
completionClaim: { ...result.completionClaim, objectiveSatisfied: false,
|
||||
remainingWork: [{ description: "Review the release notes draft.", blocksCompletion: true }] },
|
||||
blocker: { reasonCode: "review_required", owner: { kind: "user", name: "Avery Example" }, unblockAction: "Review the release notes draft.", scope: "task_wide" },
|
||||
};
|
||||
await expect(nativeCompletionFeedback(db, seeded.runId, { ...blocked, evidence: [] } as never)).rejects.toThrow("request_human_input");
|
||||
const [request] = await db.insert(issueThreadInteractions).values({
|
||||
companyId, issueId: seeded.issueId, sourceRunId: seeded.runId, createdByAgentId: agentId,
|
||||
kind: "ask_user_questions", status: "pending", effectiveResolverPolicy: "human_only", continuationPolicy: "wake_assignee",
|
||||
payload: { version: 1, questions: [{ id: "review", prompt: "Review the release notes draft.", selectionMode: "single", required: true,
|
||||
options: [{ id: "approve", label: "Approve" }, { id: "revise", label: "Revise" }] }] },
|
||||
}).returning();
|
||||
const named = { ...blocked, evidence: [{ ref: `interaction:${request!.id}` }] };
|
||||
await db.update(nativeRunResults).set({ resultJson: { ...stored!.resultJson, result: named } })
|
||||
.where(eq(nativeRunResults.id, seeded.resultId!));
|
||||
await expect(nativeCompletionFeedback(db, seeded.runId, named as never)).resolves.toContain("Blocker report accepted");
|
||||
await expect(nativeCompletionFeedback(db, seeded.runId, named as never)).resolves.toContain(`Pending request: ${request!.id}`);
|
||||
|
||||
await finalizeNativeRun({ db, runId: seeded.runId, workspaceFinalizeStatus: "succeeded" });
|
||||
const issue = (await issueService(db).getById(seeded.issueId))!;
|
||||
expect(issue.status).toBe("blocked");
|
||||
expect(issue.status).toBe("in_review");
|
||||
expect(issue.assigneeAgentId).toBe(agentId);
|
||||
expect(issue.unblockDescriptor).toEqual(expect.objectContaining({ owner: "board" }));
|
||||
expect(issue.assigneeUserId).toBeNull();
|
||||
expect((await issueThreadInteractionService(db).getById(request!.id))!.status).toBe("pending");
|
||||
const wakes = await db.select().from(agentWakeupRequests).where(eq(agentWakeupRequests.companyId, companyId));
|
||||
expect(wakes.filter((wake) => (wake.payload as Record<string, unknown> | null)?.issueId === seeded.issueId && wake.agentId === delegateAgentId)).toHaveLength(0);
|
||||
}, 30_000);
|
||||
|
||||
Reference in new issue
Block a user