Skip to content

Cron announce delivery should retry on transient channel unavailability #25842

@dwight11232-coder

Description

@dwight11232-coder

Problem

Cron job announce delivery fails immediately when the WhatsApp Web listener is momentarily disconnected (status 428 reconnect cycle). The WhatsApp connection drops periodically and reconnects within ~7 seconds, but if a cron job completes during that brief window, announce delivery fails with:

Error: No active WhatsApp Web listener (account: default)

The existing retry mechanism (up to 3 retries via announceRetryCount) only handles "requester session is busy" — not channel unavailability.

Expected Behavior

Announce delivery should retry with a short backoff (e.g. 5s, 10s, 20s) when the channel returns a transient error like UNAVAILABLE / no active listener. The WhatsApp reconnect typically completes in <10 seconds, so a single retry after 10s would catch most cases.

Current Workarounds

  • delivery.bestEffort: true — prevents the job from being marked as failed, but the message is still lost
  • Staggering cron schedules off the top of the hour — reduces collision probability but doesn't eliminate it

Logs

[whatsapp] Web connection closed (status 428). Retry 1/12 in 2.37s…
[whatsapp] Listening for personal WhatsApp inbound messages. (reconnected ~7s later)
...
⇄ res ✗ agent errorCode=UNAVAILABLE errorMessage=Error: No active WhatsApp Web listener
Subagent completion direct announce failed

Proposal

Add a retry loop (3 attempts, 10s apart) to the announce delivery path in src/agents/subagent-announce.ts when the error is a transient channel unavailability (not a permanent config error like invalid target).

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