-
-
Notifications
You must be signed in to change notification settings - Fork 69.4k
fix(cron): announce delivery + wake event cause double message delivery #40178
Copy link
Copy link
Closed
Labels
maintainerMaintainer-authored PRMaintainer-authored PR
Description
Bug
When a cron job has delivery.mode: "announce", users receive two different messages from the same cron run:
- A short summary from the cron agent's own synthesis (delivered via the completion event / wake path to the main session)
- 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
- PR fix(cron): eliminate double-announce and replace delivery polling with push-based flow #39089 fixed a different double-announce mechanism (early return paths not setting
deliveryAttempted = trueindelivery-dispatch.ts) - This is a separate issue: two different delivery paths (announce + wake) both firing for the same run
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Give feedbackNo fields configured for issues without a type.