Q44: queued runs re-check their task and are superseded when it changed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 07:59:14 -04:00
1 parent 5698e61e5a
commit 8b521ef5d9
10 files changed
+206 -19

No files matched your search

+3 -3
View File
@@ -80,10 +80,10 @@ describe("run memory", () => {
test("a run that fails before it starts is remembered too", async () => {
const h = await company(() => ({ text: "unused", toolCalls: [], rawResponseJson: "{}" }));
const kickoff = claimNextQueuedRun(h.connection)!;
h.connection.db.prepare("update tasks set assignee_agent_id = null where id = (select task_id from task_runs where id = ?)").run(kickoff.id);
await expect(h.execution.executeRun(h.orgId, kickoff.id)).rejects.toThrow("Task was reassigned after this run was queued");
h.connection.db.prepare("delete from providers where id = (select provider_id from task_runs where id = ?)").run(kickoff.id);
await expect(h.execution.executeRun(h.orgId, kickoff.id)).rejects.toThrow("Task assignee provider was not found.");
expect(h.memories().map((entry) => entry.category)).toEqual(["failure_cause"]);
expect(h.memories()[0].content).toContain("Task was reassigned after this run was queued");
expect(h.memories()[0].content).toContain("Task assignee provider was not found.");
h.connection.close();
});