Skip to content

Cron job deliver=['telegram'] fails: no delivery target resolved #17139

Description

@jscoltock

Bug Description

Cron jobs configured with deliver=['telegram'] fail to deliver output to Telegram. When the job completes, the last_delivery_error field shows: "no delivery target resolved for deliver=['telegram']".

This happens consistently across all cron jobs that target Telegram, including jobs that have been running successfully for weeks. The jobs complete successfully (output is saved to ~/.hermes/cron/output/), but the Telegram delivery step always fails with the same error.

Steps to Reproduce

  1. Create a cron job with deliver=['telegram'] (e.g., a daily briefing)
  2. Wait for the scheduled run — it saves output to file but Telegram delivery fails with "no delivery target resolved"
  3. Manually trigger the job with cronjob run — same result
  4. Run the same briefing task in an active Telegram session — works correctly

Expected Behavior

Cron job output should be delivered to the user's Telegram channel/chat when deliver=['telegram'] is set.

Actual Behavior

  • Job completes successfully (output saved to ~/.hermes/cron/output/<job_id>/)
  • last_delivery_error = "no delivery target resolved for deliver=['telegram']"
  • No message arrives in Telegram
  • Running manually in an active Telegram session works fine

Environment

  • Hermes Agent v0.11.0 (2026.04.23)
  • macOS
  • Telegram gateway connected and working (real-time messages work fine)
  • Cron jobs run on schedule, output saved correctly, only Telegram delivery fails

Additional Context

The issue appears to be in the cron worker context — when a cron job runs (whether scheduled or manually triggered via cronjob run), the Telegram platform context is not available to the delivery system, even though the user's Telegram bot and chat ID are properly configured. The delivery system can only resolve Telegram targets when running inside an active Telegram session context.

This suggests the cron worker spawns in a context that lacks the messaging platform resolution needed for deliver=['telegram']. A potential fix might involve explicitly passing the user's Telegram chat_id or home channel configuration into the cron worker context so delivery can resolve the target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/cronCron scheduler and job managementplatform/telegramTelegram bot adaptertype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions