Repository navigation
Conversation
The pre-execution (stale-progress) watchdog uses Math.min(CAP, Math.floor(jobTimeoutMs / 2)) to determine when to abort a cron job that has not emitted a new execution phase event. The /2 divisor means a job configured with timeoutSeconds: 600 is silently killed at 300s if the tool execution produces no intermediate phase events. This affects any shell command that runs silently for its entire duration: rclone sync, rsync, pg_dump, large file transfers, etc. The Codex process spawns the tool, the tool runs, and eventually returns output — but during that window the stale-progress watchdog fires at half the job timeout. Remove the /2 divisor so the pre-execution watchdog respects the full job timeout. The job-level timeout already provides the hard upper bound; the stale-progress detector should not impose a stricter one for silent but active processes. Before: rclone sync killed at 300s (half of 600s job timeout) After: rclone sync completes at ~301s (durationMs=300967 aborted=false) Fixes openclaw#83110
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection: an isolated CLI-backed cron run can call Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Land a focused cron fix that preserves fast pre-execution stall detection, clears the watchdog once CLI or embedded execution actually starts, and includes regression coverage for silent long-running commands. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection: an isolated CLI-backed cron run can call Is this the best way to solve the issue? No. Removing Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 395346fe57d5. |
Problem
resolveCronAgentPreExecutionWatchdogMs()halves the job timeout when calculating the stale-progress watchdog ceiling:This means any cron job whose tool execution runs silently (no intermediate phase events) for more than half its configured
timeoutSecondsis killed by the pre-execution watchdog — even though the job-level timeout has not been reached.Root Cause
The
/2divisor was likely intended as a safety margin: if nothing has happened in half the job timeout, something is probably wrong. However, this assumption breaks for shell commands that legitimately run silently for their entire duration:rclone sync(cloud backup transfers)rsync(large file syncs)pg_dump(database dumps)These tools produce a single
tool_execution_startedphase event, then silence until completion. The stale-progress watchdog interprets this silence as a stall and aborts.Fix
Remove the
/2divisor:The job-level timeout (
startTimeout()) already provides the hard upper bound for total run duration. The stale-progress detector should catch genuinely stalled processes (where the cap constant applies), not penalize active-but-silent ones by halving their allowed time.Production Evidence
Tested on OpenClaw 2026.5.12 (Raspberry Pi 5, ARM64):
jobTimeoutMs/2aborted=trueat 180sjobTimeoutMs/2aborted=trueat 300s (600/2)jobTimeoutMs/2aborted=trueat 600s (cap)jobTimeoutMsaborted=falseat 301sThe actual
rclone synconly needs ~5 minutes, but attempts 2 and 3 show the/2divisor killing it prematurely at exactly half the effective ceiling.Related
Files Changed
src/cron/service/timer.ts— one-line change inresolveCronAgentPreExecutionWatchdogMs()