Skip to content

Self-improving AI Employees for everyone

fix(cron): say "the last day" on the deploy path too

trohitg2b6286fa9247
diff --git a/docs-internal/node-logic-flows/workflow_triggers/cronScheduler.md b/docs-internal/node-logic-flows/workflow_triggers/cronScheduler.md
index 51ee9f1d..b3ca7c5b 100644
--- a/docs-internal/node-logic-flows/workflow_triggers/cronScheduler.md
+++ b/docs-internal/node-logic-flows/workflow_triggers/cronScheduler.md
@@ -147,6 +147,11 @@ flowchart TD
Checked against a real Temporal dev server on 2026-10-01 for every
frequency.
+- **A deployed run's `schedule` output** comes from the deploy path's own
+ copy of the description, `DeploymentManager._get_schedule_description`
+ (services never import a plugin folder). `TestScheduleDescription` in
+ `server/tests/test_cron_canary.py` keeps it reading the same as this
+ node's, `Monthly on the last day at 18:00` included.
- `iteration` is always `1`. The op does not loop; repeated firings
come from the deployed Schedule firing per tick (deployment mode).
- `interval`, `interval_minutes`, `interval_hours` are Pydantic-validated
diff --git a/server/services/deployment/manager.py b/server/services/deployment/manager.py
index d27f9554..3ade1a95 100644
--- a/server/services/deployment/manager.py
+++ b/server/services/deployment/manager.py
@@ -1422,9 +1422,10 @@ class DeploymentManager:
day_name = days[int(weekday)] if str(weekday).isdigit() else weekday
return f"Weekly on {day_name} at {time_str}"
case "months":
- day = params.get("month_day", "1")
+ day = str(params.get("month_day", "1"))
time_str = params.get("monthly_time", "09:00")
- return f"Monthly on day {day} at {time_str}"
+ on = "the last day" if day == "L" else f"day {day}"
+ return f"Monthly on {on} at {time_str}"
case "once":
return "Once (no repeat)"
case _:
diff --git a/server/tests/test_cron_canary.py b/server/tests/test_cron_canary.py
index f17df280..be020855 100644
--- a/server/tests/test_cron_canary.py
+++ b/server/tests/test_cron_canary.py
@@ -644,6 +644,40 @@ class TestCronScheduleSpec:
assert all(2000 <= r.start <= max(r.start, r.end) <= 2100 for c in calendars for r in c.year)
+class TestScheduleDescription:
+ """A deployed trigger's ``schedule`` output reads the way the node's does.
+
+ The deploy path keeps its own copy because services never import a
+ plugin folder, so this is what keeps the two from drifting.
+ """
+
+ @pytest.mark.parametrize(
+ "params",
+ [
+ pytest.param({"frequency": "seconds", "interval": 30}, id="seconds"),
+ pytest.param({"frequency": "minutes", "interval_minutes": 5}, id="minutes"),
+ pytest.param({"frequency": "hours", "interval_hours": 6}, id="hours"),
+ pytest.param({"frequency": "days", "daily_time": "09:00"}, id="days"),
+ pytest.param({"frequency": "weeks", "weekday": "5", "weekly_time": "18:00"}, id="weeks"),
+ pytest.param({"frequency": "months", "month_day": "15", "monthly_time": "08:00"}, id="months"),
+ pytest.param({"frequency": "months", "month_day": "L", "monthly_time": "18:00"}, id="last-day"),
+ pytest.param({"frequency": "once"}, id="once"),
+ ],
+ )
+ def test_the_deploy_path_matches_the_node(self, params):
+ from nodes.scheduler.cron_scheduler import _get_schedule_description
+ from services.deployment.manager import DeploymentManager
+
+ assert DeploymentManager._get_schedule_description(params) == _get_schedule_description(params)
+
+ def test_the_last_day_of_the_month_is_written_out(self):
+ from services.deployment.manager import DeploymentManager
+
+ params = {"frequency": "months", "month_day": "L", "monthly_time": "18:00"}
+
+ assert DeploymentManager._get_schedule_description(params) == "Monthly on the last day at 18:00"
+
+
# ---------------------------------------------------------------------------
# DeploymentManager cron canary integration
# ---------------------------------------------------------------------------