diff --git a/src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts b/src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts index 3b93dc67964..f0df85b6fe6 100644 --- a/src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts +++ b/src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts @@ -426,8 +426,8 @@ describe("dispatchCronDelivery — double-announce guard", () => { // NO_REPLY must be filtered out before reaching the outbound adapter. expect(deliverOutboundPayloads).not.toHaveBeenCalled(); - // No delivery was sent, so delivered stays false. - expect(state.delivered).toBe(false); + // Mark as silently delivered so the job is persisted as successful. + expect(state.delivered).toBe(true); // deliveryAttempted must be true so the heartbeat timer does not fire // a fallback enqueueSystemEvent with the NO_REPLY sentinel text. expect(state.deliveryAttempted).toBe(true); @@ -454,7 +454,7 @@ describe("dispatchCronDelivery — double-announce guard", () => { const state = await dispatchCronDelivery(params); expect(deliverOutboundPayloads).not.toHaveBeenCalled(); - expect(state.delivered).toBe(false); + expect(state.delivered).toBe(true); expect(state.deliveryAttempted).toBe(true); expect( diff --git a/src/cron/isolated-agent/delivery-dispatch.ts b/src/cron/isolated-agent/delivery-dispatch.ts index fad44594333..60fc76c0f5d 100644 --- a/src/cron/isolated-agent/delivery-dispatch.ts +++ b/src/cron/isolated-agent/delivery-dispatch.ts @@ -325,10 +325,17 @@ export async function dispatchCronDelivery( (p) => !isSilentReplyText(p.text, SILENT_REPLY_TOKEN), ); if (payloadsForDelivery.length === 0) { - // Mark attempted so the heartbeat timer does not fire a fallback - // enqueueSystemEvent with the NO_REPLY sentinel text. + // Mark as silently delivered so the heartbeat timer does not fire a fallback + // and the job is persisted as successfully delivered. deliveryAttempted = true; - return null; + delivered = true; + return params.withRunSession({ + status: "ok", + summary, + outputText, + delivered: true, + ...params.telemetry, + }); } if (params.isAborted()) { return params.withRunSession({