Skip to content

fix(cron): announce delivery + wake event cause double message delivery #40178

@tyler6204

Description

@tyler6204

Bug

When a cron job has delivery.mode: "announce", users receive two different messages from the same cron run:

  1. A short summary from the cron agent's own synthesis (delivered via the completion event / wake path to the main session)
  2. The full detailed output from the cron's subagent (delivered directly via the announce delivery path)

These are two different messages with different content, both from the same single cron run.

Root Cause

The cron agent spawns a subagent to do the actual work. When the subagent completes:

  • The announce delivery path sends the subagent's full output directly to the user's channel
  • The wake/completion event path sends the cron agent's shorter parent synthesis to the main session, which relays it

Both paths fire independently, resulting in two messages.

Expected Behavior

Only one message should be delivered per cron run. The announce flow should consolidate the parent and subagent outputs into a single delivery.

Workaround

Setting delivery.mode: "none" prevents the direct announce delivery, so only the completion event reaches the main session. But this shouldn't be required.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainerMaintainer-authored PR

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions