Repository navigation
Fix false failures in completed and queued automations - #152174
Conversation
Closes #148874 Heartbeat cron jobs report execution timeouts while queued behind foreground work. Queue entry pauses the cron watchdog; attempt start arms it. This state has one writer. Retries retain their final outcome, including after handler replacement. Growth: `timer-job-runner.ts` +7 (deadline), `timer-execution.ts` +1 (handoff), `timer-execution-timeout.ts` +5 (type), `session-event-wake.ts` +18 (notifications). Growth accepted under the owner's standing acceptance (2026-09-15). Queue waits no longer create false errors. Actual failures and execution deadlines remain effective. Real Gateway: hold a `chat.send` response for five seconds; call `cron.run` with a two-second heartbeat timeout; read `cron.runs`/`cron.get`. Main expired at 2,010 ms before any heartbeat request, with one consecutive error. The fix stayed pending, then recorded the retained retry's success at 60.4 seconds. Separate controls recorded a failed retry and an executing timeout, each with one consecutive error. Preserves #134464 outcome accounting. No config, schema, protocol or SDK change. #148333's next-cadence policy remains separate. Scheduled monitors, heartbeat tasks and immediate cron events. Enqueue pauses the deadline; attempts restart it; completion disposes it. 196 tests passed on a fresh merge with main; 27 focused tests also cover unlimited heartbeats. Original-code negative controls fail. Type-aware checks passed. Immediate handoff, coalescing and cancellation remain unchanged and covered. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 4e88587)
* fix: preserve completed scheduled reports after tool read failures * fix: keep cron failures after progress-only messages (cherry picked from commit e731216)
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d744a84d6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
The candidate build and production typecheck passed. Broad optional CI reports the same inherited release-line failures as #151874: existing lint/dead-code/boundary and Slack test-fixture issues, plus two stale runtime assertions. The 85 Slack failures match the base exactly, and both runtime assertions also fail when run directly at the unchanged e56ad89 release base. No files responsible for those failures changed in this backport. The 131 focused delivery, scheduler, heartbeat, queue, and terminal-error cases pass. This PR retains only the two upstream repairs and their necessary release-line conflict resolution; it does not fold unrelated release maintenance into the automation fix. |
3c78fdc
into
sjf_openclaw_2026-09-04
Scheduled work can report a failure after it has already delivered its report, and heartbeat jobs can time out while merely waiting behind foreground work. This backports #152165 and #148876 to the current release branch so completed reports retain their successful outcome and heartbeat execution time starts when the queued work actually runs.
Run-level errors, interrupted runs, explicitly progress-only messages, missing final answers, and execution deadlines keep their existing handling. The backport preserves the release branch’s existing abort handling and queue function signature. It changes no configuration, persisted-state format, or model runtime requirements.
Upstream commits:
e73121691a6314c8a6f4c0b7807fff0e807d23d3and4e885874ce965a929b1d9ba69c738f1f6e298767; release base:e56ad899fff8799366480edb387d8b9c63dc3636.