mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
fix(cron): show delivery failure inline with last-run status
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
This commit is contained in:
parent
a521005fe5
commit
c08accb2f1
2 changed files with 11 additions and 4 deletions
|
|
@ -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}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue