Cron: drop legacy relay expectations

This commit is contained in:
Mariano Belinky
2026-03-09 20:07:23 +01:00
parent cfdc23be9f
commit 5877389e33
2 changed files with 6 additions and 11 deletions

View File

@@ -86,7 +86,7 @@ describe("CronService delivery plan consistency", () => {
});
});
it("treats delivery object without mode as announce", async () => {
it("treats delivery object without mode as announce without reviving legacy relay fallback", async () => {
await withCronService({}, async ({ cron, enqueueSystemEvent }) => {
const job = await addIsolatedAgentTurnJob(cron, {
name: "partial-delivery",
@@ -96,10 +96,8 @@ describe("CronService delivery plan consistency", () => {
const result = await cron.run(job.id, "force");
expect(result).toEqual({ ok: true, ran: true });
expect(enqueueSystemEvent).toHaveBeenCalledWith(
"Cron: done",
expect.objectContaining({ agentId: undefined }),
);
expect(enqueueSystemEvent).not.toHaveBeenCalled();
expect(cron.getJob(job.id)?.state.lastDeliveryStatus).toBe("unknown");
});
});

View File

@@ -86,7 +86,7 @@ describe("cron isolated job HEARTBEAT_OK summary suppression (#32013)", () => {
expect(requestHeartbeatNow).not.toHaveBeenCalled();
});
it("still enqueues real cron summaries as system events", async () => {
it("does not revive legacy main-session relay for real cron summaries", async () => {
const { storePath } = await makeStorePath();
const now = Date.now();
@@ -109,10 +109,7 @@ describe("cron isolated job HEARTBEAT_OK summary suppression (#32013)", () => {
await runScheduledCron(cron);
// Real summaries SHOULD be enqueued.
expect(enqueueSystemEvent).toHaveBeenCalledWith(
expect.stringContaining("Weather update"),
expect.objectContaining({ agentId: undefined }),
);
expect(enqueueSystemEvent).not.toHaveBeenCalled();
expect(requestHeartbeatNow).not.toHaveBeenCalled();
});
});