From c08accb2f1fa50f363d3df2764b3227833bc32e2 Mon Sep 17 00:00:00 2001 From: UGBOMEH OGOCHUKWU WILLIAMS Date: Sun, 19 Apr 2026 15:42:40 +0100 Subject: [PATCH] fix(cron): show delivery failure inline with last-run status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a cron job's agent run succeeds but delivery to a channel (Discord, Telegram, etc.) fails, `last_status` is "ok" while `last_delivery_error` holds the failure reason. The previous display printed a separate yellow warning line that was easy to miss — the status cell still showed a plain green "ok", making the job look healthy at a glance. This commit surfaces the failure directly in the status cell: hermes_cli/cron.py (`hermes cron list`) "ok" → "ok ⚠ delivery failed" (green + yellow) when `last_delivery_error` is set; the detail line below is kept. cli.py (in-chat /cron list) Status string becomes "ok ⚠ delivery failed" and a "Delivery error: …" line is printed below it. No changes to cron/jobs.py or the data model — `last_status` still reflects agent execution only, per the maintainer design decision. Fixes #5861 --- cli.py | 7 ++++++- hermes_cli/cron.py | 8 +++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cli.py b/cli.py index 0e5e9ff660..6d753857d3 100644 --- a/cli.py +++ b/cli.py @@ -5339,7 +5339,12 @@ class HermesCLI: print(f" Skills: {', '.join(job['skills'])}") print(f" Prompt: {job.get('prompt_preview', '')}") if job.get("last_run_at"): - print(f" Last run: {job['last_run_at']} ({job.get('last_status', '?')})") + delivery_err = job.get("last_delivery_error") + last_status = job.get("last_status", "?") + status_str = f"{last_status} ⚠ delivery failed" if (last_status == "ok" and delivery_err) else last_status + print(f" Last run: {job['last_run_at']} ({status_str})") + if delivery_err: + print(f" Delivery error: {delivery_err}") print() return diff --git a/hermes_cli/cron.py b/hermes_cli/cron.py index e0ab6007a8..e58065ae59 100644 --- a/hermes_cli/cron.py +++ b/hermes_cli/cron.py @@ -96,15 +96,17 @@ def cron_list(show_all: bool = False): # Execution history last_status = job.get("last_status") + delivery_err = job.get("last_delivery_error") if last_status: last_run = job.get("last_run_at", "?") if last_status == "ok": - status_display = color("ok", Colors.GREEN) + if delivery_err: + status_display = color("ok", Colors.GREEN) + " " + color("⚠ delivery failed", Colors.YELLOW) + else: + status_display = color("ok", Colors.GREEN) else: status_display = color(f"{last_status}: {job.get('last_error', '?')}", Colors.RED) print(f" Last run: {last_run} {status_display}") - - delivery_err = job.get("last_delivery_error") if delivery_err: print(f" {color('⚠ Delivery failed:', Colors.YELLOW)} {delivery_err}")