mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 17:46:37 +00:00
* fix(cron): pass heartbeat target=last for main-session cron jobs When a cron job with sessionTarget=main and wakeMode=now fires, it triggers a heartbeat via runHeartbeatOnce. Sincee2362d35changed the default heartbeat target from "last" to "none", these cron-triggered heartbeats silently discard their responses instead of delivering them to the last active channel (e.g. Telegram). Fix: pass heartbeat: { target: "last" } from the cron timer to runHeartbeatOnce for main-session jobs, and wire the override through the gateway cron service builder. This restores delivery for sessionTarget=main cron jobs without reverting the intentional default change for regular heartbeats. Regression introduced in:e2362d35(2026-02-25) Fixes #28508 * Cron: align server-cron wake routing expectations for main-target jobs --------- Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -56,6 +56,8 @@ export type CronServiceDeps = {
|
||||
reason?: string;
|
||||
agentId?: string;
|
||||
sessionKey?: string;
|
||||
/** Optional heartbeat config override (e.g. target: "last" for cron-triggered heartbeats). */
|
||||
heartbeat?: { target?: string };
|
||||
}) => Promise<HeartbeatRunResult>;
|
||||
/**
|
||||
* WakeMode=now: max time to wait for runHeartbeatOnce to stop returning
|
||||
|
||||
@@ -663,6 +663,11 @@ export async function executeJobCore(
|
||||
reason,
|
||||
agentId: job.agentId,
|
||||
sessionKey: targetMainSessionKey,
|
||||
// Cron-triggered heartbeats should deliver to the last active channel.
|
||||
// Without this override, heartbeat target defaults to "none" (since
|
||||
// e2362d35) and cron main-session responses are silently swallowed.
|
||||
// See: https://github.com/openclaw/openclaw/issues/28508
|
||||
heartbeat: { target: "last" },
|
||||
});
|
||||
if (
|
||||
heartbeatResult.status !== "skipped" ||
|
||||
|
||||
Reference in New Issue
Block a user