This commit is contained in:
Daniel Galinkin 2026-09-13 12:08:45 +00:00 committed by GitHub
commit 863a8ff23d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 31 additions and 0 deletions

View File

@ -510,6 +510,37 @@ describe("issue update comment wakeups", () => {
expect(mockIssueService.update).not.toHaveBeenCalled();
});
it("keeps the normal assignment wake when goal wake deferral is explicitly false", async () => {
const existing = makeIssue({ assigneeAgentId: null, assigneeUserId: null, status: "todo" });
const updated = makeIssue({
assigneeAgentId: ASSIGNEE_AGENT_ID,
assigneeUserId: null,
status: "todo",
});
mockIssueService.getById.mockResolvedValue(existing);
mockIssueService.update.mockResolvedValue(updated);
const res = await request(await createApp()).patch(`/api/issues/${existing.id}`).send({
assigneeAgentId: ASSIGNEE_AGENT_ID,
assigneeUserId: null,
deferWakeForGoal: false,
});
expect(res.status).toBe(200);
await vi.waitFor(() => expect(mockHeartbeatService.wakeup).toHaveBeenCalledTimes(1));
expect(mockHeartbeatService.wakeup).toHaveBeenCalledWith(
ASSIGNEE_AGENT_ID,
expect.objectContaining({
source: "assignment",
reason: "issue_assigned",
payload: expect.objectContaining({
issueId: existing.id,
mutation: "update",
}),
}),
);
});
it("wakes the assignee on comment-only issue updates", async () => {
const existing = makeIssue({
assigneeAgentId: ASSIGNEE_AGENT_ID,