Skip to content

Cherry-pick 8ae1987f2: fix(cron): pass heartbeat target=last for main-session cron jobs#1393

Merged
alexey-pelykh merged 2 commits intomainfrom
cherry-pick/8ae1987f2-heartbeat-target-last
Mar 15, 2026
Merged

Cherry-pick 8ae1987f2: fix(cron): pass heartbeat target=last for main-session cron jobs#1393
alexey-pelykh merged 2 commits intomainfrom
cherry-pick/8ae1987f2-heartbeat-target-last

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Cherry-pick of upstream commit 8ae1987f2.

Author: Marcus Widing
Category: Cron fix

Passes heartbeat: { target: "last" } for main-session cron jobs so cron-triggered heartbeats deliver to the last active channel instead of being silently swallowed.

Conflict resolution: Fork already replaced targetMainSessionKey with job.sessionKey — kept fork's sessionKey and added upstream's heartbeat: { target: "last" }.

Part of #674.

widingmarcus-cyber and others added 2 commits March 15, 2026 06:37
…nclaw#28508) (openclaw#28583)

* 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. Since e2362d3 changed 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: e2362d3 (2026-02-25)

Fixes openclaw#28508

* Cron: align server-cron wake routing expectations for main-target jobs

---------

Co-authored-by: Tak Hoffman <[email protected]>
(cherry picked from commit 8ae1987)
- Fix agentEntry type narrowing (false | AgentConfig → AgentConfig | undefined)
- Revert test assertions to match fork's resolveCronSessionKey behavior
@alexey-pelykh alexey-pelykh merged commit e92921e into main Mar 15, 2026
7 checks passed
@alexey-pelykh alexey-pelykh deleted the cherry-pick/8ae1987f2-heartbeat-target-last branch March 15, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants