Skip to content

Cron announce mode without explicit recipient relies on dead code #8906

@mcaxtr

Description

@mcaxtr

Problem

When a cron job uses delivery.mode = "announce" without an explicit to recipient (relying on last-session target resolution via channel: "last"), delivery never triggers.

Current Behavior

The delivery logic requires an explicit to field to request delivery. Jobs configured like this won't deliver:

job.delivery = { mode: "announce", channel: "last" }  // no "to", expects last-session resolution

Root Cause

There's a resolveCronDeliveryPlan() function in src/cron/delivery.ts that correctly handles this:

if (hasDelivery) {
  return {
    requested: resolvedMode === "announce",  // true regardless of "to"
    ...
  };
}

However, this function was added but never integrated into the execution path. It's dead code.

Proposed Solution

Wire up resolveCronDeliveryPlan() into the cron isolated agent runner, or extract its logic into the wrapper.

Notes

All existing tests use announce mode with explicit to, so this scenario was never covered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions