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
+3
View File
@@ -3221,6 +3221,9 @@ def test_gateway_local_trigger_queue_submits_agent_turns(
def register_system_job(self, _job) -> None:
return None
def remove_system_job(self, _job_id: str) -> bool:
return False
class _FakeAgentLoop(_GatewayAgentContractStub):
@classmethod
def from_config(cls, config, bus=None, **extra):