fix(cron): retire persisted heartbeat/dream jobs when disabled

Disabling gateway.heartbeat (or agents.defaults.dream) only skipped
job registration on startup; the previously persisted system job in
<workspace>/cron/jobs.json kept firing, and remove_job refuses to
touch protected system jobs. Add CronService.remove_system_job for
startup reconciliation and call it from the gateway disabled branches
so the config toggle takes effect after restart.
This commit is contained in:
aiguozhi123456
2026-08-22 02:38:47 +08:00
committed by chengyongru
parent 1fe36d5dec
commit e5718d4de6
5 changed files with 61 additions and 0 deletions
+1
View File
@@ -211,6 +211,7 @@ def test_load_store_falls_back_to_in_memory_on_corruption_after_start(
("enable_job", lambda service: service.enable_job("missing", enabled=False)),
("update_job", lambda service: service.update_job("missing", name="new name")),
("register_system_job", lambda service: service.register_system_job(_system_job())),
("remove_system_job", lambda service: service.remove_system_job("heartbeat")),
],
)
def test_public_apis_raise_clear_error_for_unavailable_corrupt_store(