Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
Public automation creation accepts declaration keys beginning with heartbeat-task:, causing an ordinary main-session system event to be treated as a doctor-migrated heartbeat task.
Steps to reproduce
- Start an isolated Gateway with heartbeat disabled.
- Create a recurring main-session
systemEventautomation whose declaration key begins withheartbeat-task:. - Force the automation to run.
- Observe that cron reports success and requests a heartbeat-task wake instead of enqueueing the normal system event.
Expected behavior
Only the system-owned heartbeat-task migration path may create jobs in the reserved heartbeat-task: declaration namespace. Ordinary public declarations should be rejected before persistence.
Actual behavior
The public declaration is persisted. Prefix-based runtime classification routes it through the guarded heartbeat wake path and reports success even when heartbeat is disabled, so the normal system-event delivery path is bypassed.
OpenClaw version
Current main before the fix; reproduced at 493a3e46b3f2921269cfb0af5dfc86efb569ceaa. The affected files were unchanged through 2bc1699a37fb957fe8e80c0cd4a087d4b3c279c6.
Operating system
macOS 26 focused reproduction; Ubuntu 24.04 isolated Gateway confirmation.
Install method
Source checkout with built CLI and isolated Gateway state.
Model
N/A (scheduler-only path; no model invoked)
Provider / routing chain
N/A (local CLI → local Gateway cron service)
Additional provider/model setup details
N/A
Logs
AssertionError: promise resolved instead of rejecting
Received declarationKey: heartbeat-task:main:<redacted-hash>The pre-fix service run then enters the heartbeat-task branch, calls the heartbeat wake queue, skips normal main-session event enqueueing, and returns an ok cron result.
Screenshots, recordings, and evidence
Focused pre-fix regression and an isolated built CLI/Gateway proof are available in the linked repair PR.
Impact and severity
Affected: operators or automation callers using a reserved-looking declaration key.
Severity: medium; the automation reports success while its normal system event is not delivered.
Frequency: deterministic for matching main-session systemEvent declarations.
Consequence: silent automation non-delivery, especially when heartbeat is disabled.
Additional information
The clean repair belongs at cron creation ownership: reserve the namespace through the existing systemOwned service authority while keeping already-migrated rows executable, editable, and removable. No Gateway schema, public config, protocol, or storage change is required.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Aug 14, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 14, 2026, 12:22 PM ET / 16:22 UTC.
Summary
Keep open: current main accepts the reserved prefix, classifies it as a heartbeat task at execution, and bypasses normal system-event delivery. The open linked repair PR owns the focused fix, while the protected maintainer label prevents automatic closure or duplicate repair dispatch.
Reproducibility: yes. —source inspection provides a high-confidence path: create a main-session system-event cron job with a
heartbeat-task:declaration key, force-run it, and observe the earlier heartbeat-task branch.Root-cause cluster
Relationship:
canonicalCanonical: #123728
Summary: This issue is the canonical report, and the linked open PR is its candidate fix.
Members:
fixed_by_candidate: fix(cron): reserve migrated heartbeat-task namespace #123729 - It explicitly closes this issue and changes the same cron creation and heartbeat-task classification boundary.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
The linked open PR already owns the narrow repair, and the protected maintainer label keeps this issue out of automatic fix and close lanes.
Review details
Best possible solution:
Land the linked repair after PR-specific review confirms only system-owned migration calls can create the reserved prefix while existing migrated rows remain manageable.
Do we have a high-confidence way to reproduce the issue?
Yes—source inspection provides a high-confidence path: create a main-session system-event cron job with a
heartbeat-task:declaration key, force-run it, and observe the earlier heartbeat-task branch.Is this the best way to solve the issue?
Yes—the linked repair addresses creation ownership, the boundary that can reject untrusted reserved keys before persistence while preserving doctor-migrated rows.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 2b31cf114ba4.
Label changes
Label changes:
P1: A deterministic current-main cron path silently suppresses a scheduled main-session event while reporting success.impact:other: The concrete impact is silent automation non-delivery, which does not map cleanly to the more specific issue impact classes.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:linked-pr-open: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.Label justifications:
P1: A deterministic current-main cron path silently suppresses a scheduled main-session event while reporting success.impact:other: The concrete impact is silent automation non-delivery, which does not map cleanly to the more specific issue impact classes.Evidence reviewed
What I checked:
src/cron/heartbeat-task.ts:24, 2b31cf114ba4)src/cron/service/timer-execution.ts:181, 2b31cf114ba4)src/cron/service/ops-mutations.ts:309, 2b31cf114ba4)src/cron/service.heartbeat-payload.test.ts:91, 2b31cf114ba4)src/commands/doctor-heartbeat-task-migration.ts:164, 2b31cf114ba4)Likely related people:
src/cron/service/timer-execution.ts)src/cron/heartbeat-task.ts,src/cron/service/ops-mutations.ts,src/cron/service.heartbeat-payload.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.steipete commentedon Aug 14, 2026
Fixed on
mainby PR #123729, merged as ffd42dd.The cron creation owner now rejects public
heartbeat-task:declaration keys before persistence unless the caller has the existing system-owned authority. Migrated rows remain executable, editable, and removable.Proof: 14 focused cron/migration tests, the exact five-path changed gate, full build, isolated built CLI/Gateway behavior with heartbeat disabled, clean immutable autoreview, ClawSweeper with no findings, and green exact-head CI run https://github.com/openclaw/openclaw/actions/runs/31818553650.