From 2536ff328b18f3155695b87f59c7ec31629e129d Mon Sep 17 00:00:00 2001 From: teknium1 Date: Sat, 14 Mar 2026 19:28:52 -0700 Subject: [PATCH] fix: prefer prompt names for multi-skill cron jobs --- cron/jobs.py | 2 +- tests/tools/test_cronjob_tools.py | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/cron/jobs.py b/cron/jobs.py index c55282a894..ca00e08dbc 100644 --- a/cron/jobs.py +++ b/cron/jobs.py @@ -323,7 +323,7 @@ def create_job( now = _hermes_now().isoformat() normalized_skills = _normalize_skill_list(skill, skills) - label_source = (normalized_skills[0] if normalized_skills else prompt) or "cron job" + label_source = (prompt or (normalized_skills[0] if normalized_skills else None)) or "cron job" job = { "id": job_id, "name": name or label_source[:50].strip(), diff --git a/tests/tools/test_cronjob_tools.py b/tests/tools/test_cronjob_tools.py index 5522fb7bdf..97a4cd5227 100644 --- a/tests/tools/test_cronjob_tools.py +++ b/tests/tools/test_cronjob_tools.py @@ -262,6 +262,18 @@ class TestUnifiedCronjobTool: listing = json.loads(cronjob(action="list")) assert listing["jobs"][0]["skills"] == ["blogwatcher", "find-nearby"] + def test_multi_skill_default_name_prefers_prompt_when_present(self): + result = json.loads( + cronjob( + action="create", + skills=["blogwatcher", "find-nearby"], + prompt="Use both skills and combine the result.", + schedule="every 1h", + ) + ) + assert result["success"] is True + assert result["name"] == "Use both skills and combine the result." + def test_update_can_clear_skills(self): created = json.loads( cronjob(