Skip to content

fix: stop expected automation skips from posting did-not-start notices - #194276

Merged
obviyus merged 3 commits into
openclaw:mainfrom
wr-web:fix/cron-deferred-skip-notice
Nov 18, 2026
Merged

obviyus merged 3 commits into
openclaw:mainfrom
wr-web:fix/cron-deferred-skip-notice

Conversation

@wr-web

@wr-web wr-web commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: src/gateway/server-cron-notifications.ts:581 treats every skipped run as "did not start", because src/cron/service/timer-outcome-finalization.ts:153 never forwards the executor's existing admissionDeferredReason ("active-hours" or "busy") in the transient CronEventContext, so expected deferrals are written into the owner conversation as failures.

Fixes #194261. Thanks @slatem for the detailed report and @wr-web for the fix.

What Problem This Solves

Since 2026.11.5-beta.1, every skipped automation run writes this notice into the job's owner conversation:

Automation "" did not start: Check automation history, resolve the cause, then run it again.

That includes scheduled deferrals that need no fixing: a tick outside the job's active hours, or an idle-only run deferred while the agent is busy. For heartbeat-style jobs whose session target is the agent's own main session, the notice lands in the session the next run executes in. The next announced reply repeats it, and the copies multiply every cycle. The reporter saw 163 Slack messages in about 25 minutes, each with up to 26 copies.

User Impact

Active-hours and busy deferrals no longer post a "did not start" notice, so they no longer feed the next run. Run history still records them as skipped with the same summary, and completion webhooks are unchanged. Other unstarted outcomes keep the notice: preparation or admission errors, and skips without a deferral reason.

Why This Change Was Made

The executor already classifies these outcomes with admissionDeferredReason (timer-execution.ts). Finalization now forwards that fact in the transient CronEventContext, next to runNotStarted and quietTrigger; it is not projected into the public CronEvent. The notifier skips the conversation notice when the reason is present. No new classifier, wording, setting or stored state.

Evidence

Real Gateway from source (ocx src), isolated state, deterministic local Responses provider that records every model request. A heartbeat job (every 1h, session target session:agent:main:main, active hours excluding now) is run three times, then its active hours are cleared and it runs once more (the next in-hours run). Control: a second job in the same session with skipIfScratchEmpty and an explicitly empty scratch, which skips without a deferral reason.

main 5e677ba this PR a0b0a95
3 active-hours runs skipped, "Outside this automation's active hours" same
"did not start" notices in the session 3 0
copies of the notice in the next run's model input 3 0
control: scratch-empty skip notice written (3 -> 4) written (0 -> 1)

Raw output from both runs: #194276 (comment)

  • src/gateway/server-cron-notifications.test.ts: the existing conversation-outcome table gains active-hours and busy rows that expect no conversation commit while the completion webhook is still sent. Both rows fail on main and pass here (29/29). Test lines net 0.
  • Production change: +12 lines across three files, no deletions.
  • The contributor's earlier Windows proof (isolated source Gateway, CLI cron run --wait) showed the same result: the notice in the main session's transcript tables on main, none with this change.

Merge danger: two-way door. A revert restores the old notices; nothing is stored or migrated. Blast radius: owner-conversation notices for skipped cron runs only.

Every skipped run posted 'Automation "<name>" did not start: ... resolve the
cause' into the owner conversation, including a run outside the job's active
hours or an idle-only run deferred while the agent was busy. For a job that
runs in its owner session the notice also entered the next run's context, so
announced replies repeated and multiplied it. Carry the admission deferral
reason in the finished event context and skip the notice for those
scheduled deferrals; run history still records them.

Refs openclaw#194261
@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Nov 6, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 6, 2026
@wr-web

wr-web commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Suppresses owner-conversation notices for expected active-hours and busy automation deferrals while retaining run history and completion webhooks.

Example: The heartbeat automation runs three times outside its active hours, then runs once inside its window.

  • Before: Three did-not-start notices enter its conversation and appear three times in the next model request.
  • After: No deferral notices enter the conversation or next model request; an unrelated scratch-empty skip still produces its notice.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A narrow repair with real Gateway evidence, useful regression coverage, preserved neighboring behavior, and no actionable patch findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): obviyus's exact-head isolated Gateway trace exercises active-hours deferrals through the real scheduler and conversation path, then records the next Responses request: notices and copied model-input text fall from three to zero, while the scratch-empty control remains visible; busy deferrals additionally have a reported red-on-base, green-on-head regression case.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Ordinary scheduling deferrals produce failure-style conversation notices that subsequent heartbeat runs repeat into the delivery channel.
Reason: The change removes a demonstrated feedback source using the established quiet-outcome mechanism without adding a setting or changing genuine failure reporting.

Regression provenance

Regression provenance — suspected predecessor, not a causality claim: source commit 5f15db71e8e9 by Peter Steinberger; no PR verified.

Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR provides a focused, demonstrated fix for automation-notice feedback still present on current main, with no introduced defects found. Exact-head CI remains blocked by a failure-alert assertion independently reported on main.

Priority: P1
Reviewed head: a0b0a959d09725d4d555fef930a5e5d1329659fa

Before merge

None.

Findings

None.

Agent review details

How this fits together

The cron executor classifies admission outcomes, finalization publishes terminal events with transient context, and the Gateway notification handler decides whether to write an owner-conversation notice or send a completion webhook.

flowchart TD
  A[Cron executor] --> B[Run finalization]
  B --> C[Run history]
  B --> D[Terminal event and transient context]
  D --> E[Gateway notification handler]
  E --> F[Owner conversation]
  E --> G[Completion webhook]
Loading

Technical review

Best possible solution:

Land the existing transient-context fix while preserving genuine non-start notices, scheduling, history, and webhook behavior.

Do we have a high-confidence way to reproduce the issue?

The executor-to-notifier path establishes the failure on current main, and the supplied real-Gateway comparison demonstrates the notice and subsequent model-input contamination before the fix.

Is this the best way to solve the issue?

The patch is the smallest complete fix: preserve the scheduler's existing deferral classification through transient event context and let the existing notification owner suppress only those expected outcomes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ee3f5a72fb75.

Provenance checked

  • Owner-conversation non-start notices changes intended behavior with a stated reason (32bff6b: Make genuine skipped or unstarted forced runs visible to the owning conversation.)
  • Transient quiet-outcome context keeps the original intent (5f15db7: Keep successful quiet trigger checks out of chat while preserving terminal accounting and completion webhooks.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +12, Tests 0. Total +12 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 12 0 +12
Tests 1 5 5 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 17 5 +12

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #194261
Summary: This PR addresses the reported owner-conversation feedback loop; the merged primary-webhook fix concerns a separate delivery path.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: Expected scheduling skips can pollute future agent context and amplify announced messages; the linked report describes 163 Slack messages in about 25 minutes.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (4 earlier review cycles)
  • reviewed 2026-11-06T18:55:01.573Z sha b0c2eb8 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-06T19:01:28.197Z sha b0c2eb8 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-09T12:55:10.150Z sha b0c2eb8 :: needs maintainer review before merge. :: none
  • reviewed 2026-11-09T14:40:18.326Z sha 0d4bab4 :: needs maintainer review before merge. :: none

Reviewed November 18, 2026, 1:41 AM ET / 06:41 UTC (Revision 5).

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 6, 2026
@wr-web

wr-web commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Added raw terminal output from a fresh live run in place of the typeset table. The run used an isolated source Gateway on current main 8893bdef5222, once with main's cron files and once with this PR's. On main, the active-hours skip writes the "Automation "heartbeat" did not start" notice into the agent's transcript, FTS and memory-index tables. With this PR, the same skip records the run as skipped and leaves no notice. Details are in the PR body.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 9, 2026
@wr-web

wr-web commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged current main (0d4bab4456a1). The earlier required-check failures came from the base at that time and touched none of this PR's files: extensions/deep-research/browser type errors and the shared build failure. All checks now pass on the new head.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 9, 2026
@obviyus

obviyus commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus obviyus changed the title fix(cron): no did-not-start notice for expected admission deferrals fix: stop expected automation skips from posting did-not-start notices Nov 18, 2026
@obviyus

obviyus commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Runtime proof: real Gateway from source, isolated state, local Responses provider recording each model request (harness steps in the PR body).

main 5e677bad858c
deferrals: skipped_runs=3 "summary": "Outside this automation's active hours"
session notices after 3 active-hours deferrals: 3
next in-hours run model request: did-not-start copies in model input=3
control (scratch-empty skip, no deferral reason): "summary": "Automation scratch is explicitly empty" notices 3 -> 4
   3 Automation \"heartbeat\" did not start: Outside this automation's active hours Check automation history, resolve the cause, then run it again.
   1 Automation \"scratch-control\" did not start: Automation scratch is explicitly empty Check automation history, resolve the cause, then run it again.

PR a0b0a959d097
deferrals: skipped_runs=3 "summary": "Outside this automation's active hours"
session notices after 3 active-hours deferrals: 0
next in-hours run model request: did-not-start copies in model input=0
control (scratch-empty skip, no deferral reason): "summary": "Automation scratch is explicitly empty" notices 0 -> 1
   1 Automation \"scratch-control\" did not start: Automation scratch is explicitly empty Check automation history, resolve the cause, then run it again.

@obviyus

obviyus commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Maintainer override: checks-node-changed-1 on a0b0a95 (https://github.com/openclaw/openclaw/actions/runs/44248141887/job/134613630397) fails one case that also fails on main without this PR.

Failing case: src/cron/cron-delivery-outcomes.e2e.test.ts > cron delivery outcomes > applies threshold and cooldown once before transporting execution failure alerts. The webhook message is Automation "60-second monitor" failed where the test expects ... failed 2 times in a row.

main 5e677bad858c (the CI merge's main parent), no PR changes:
node scripts/run-vitest.mjs run src/cron/cron-delivery-outcomes.e2e.test.ts
 × applies threshold and cooldown once before transporting execution failure alerts
   Tests  1 failed | 5 passed (6)
-     "message": "Automation \"60-second monitor\" failed 2 times in a row
+     "message": "Automation \"60-second monitor\" failed

PR head a0b0a959d097 (ocx test, same file): same case fails with the same diff, 1 failed | 5 passed (6).

The PR cannot reach this case: the test runs execution errors (no admissionDeferredReason) through the failure-alert webhook path, and calls the notifier without resolveCronAgent, so the conversation-notice branch this PR changes never runs. All other required checks passed.

@obviyus
obviyus merged commit 4b0d39b into openclaw:main Nov 18, 2026
202 of 211 checks passed
@obviyus

obviyus commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks @wr-web for the fix and @slatem for the report. This is merged in 4b0d39b: expected automation deferrals (outside active hours, or a busy target) no longer post a "did not start" notice into the job's own session, so the next run no longer reads them and Slack output no longer snowballs. Real failures to start still notify.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
openclaw#194276)

Root cause: src/gateway/server-cron-notifications.ts:581 treats every skipped run as "did not start", because src/cron/service/timer-outcome-finalization.ts:153 never forwards the executor's existing `admissionDeferredReason` ("active-hours" or "busy") in the transient CronEventContext, so expected deferrals are written into the owner conversation as failures.

Fixes openclaw#194261. Thanks @slatem for the detailed report and @wr-web for the fix.

## What Problem This Solves

Since 2026.11.5-beta.1, every skipped automation run writes this notice into the job's owner conversation:

> Automation "<name>" did not start: <reason> Check automation history, resolve the cause, then run it again.

That includes scheduled deferrals that need no fixing: a tick outside the job's active hours, or an idle-only run deferred while the agent is busy. For heartbeat-style jobs whose session target is the agent's own main session, the notice lands in the session the next run executes in. The next announced reply repeats it, and the copies multiply every cycle. The reporter saw 163 Slack messages in about 25 minutes, each with up to 26 copies.

## User Impact

Active-hours and busy deferrals no longer post a "did not start" notice, so they no longer feed the next run. Run history still records them as skipped with the same summary, and completion webhooks are unchanged. Other unstarted outcomes keep the notice: preparation or admission errors, and skips without a deferral reason.

## Why This Change Was Made

The executor already classifies these outcomes with `admissionDeferredReason` (timer-execution.ts). Finalization now forwards that fact in the transient CronEventContext, next to `runNotStarted` and `quietTrigger`; it is not projected into the public CronEvent. The notifier skips the conversation notice when the reason is present. No new classifier, wording, setting or stored state.

## Evidence

Real Gateway from source (`ocx src`), isolated state, deterministic local Responses provider that records every model request. A heartbeat job (every 1h, session target `session:agent:main:main`, active hours excluding now) is run three times, then its active hours are cleared and it runs once more (the next in-hours run). Control: a second job in the same session with `skipIfScratchEmpty` and an explicitly empty scratch, which skips without a deferral reason.

| | main bec4cf3 | this PR a0b0a95 |
| --- | --- | --- |
| 3 active-hours runs | skipped, "Outside this automation's active hours" | same |
| "did not start" notices in the session | 3 | 0 |
| copies of the notice in the next run's model input | 3 | 0 |
| control: scratch-empty skip notice | written (3 -> 4) | written (0 -> 1) |

Raw output from both runs: openclaw#194276 (comment)

- `src/gateway/server-cron-notifications.test.ts`: the existing conversation-outcome table gains active-hours and busy rows that expect no conversation commit while the completion webhook is still sent. Both rows fail on main and pass here (29/29). Test lines net 0.
- Production change: +12 lines across three files, no deletions.
- The contributor's earlier Windows proof (isolated source Gateway, CLI `cron run --wait`) showed the same result: the notice in the main session's transcript tables on main, none with this change.

Merge danger: two-way door. A revert restores the old notices; nothing is stored or migrated. Blast radius: owner-conversation notices for skipped cron runs only.

Co-authored-by: Ayaan Zaidi <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
#194276)

Root cause: src/gateway/server-cron-notifications.ts:581 treats every skipped run as "did not start", because src/cron/service/timer-outcome-finalization.ts:153 never forwards the executor's existing `admissionDeferredReason` ("active-hours" or "busy") in the transient CronEventContext, so expected deferrals are written into the owner conversation as failures.

Fixes #194261. Thanks @slatem for the detailed report and @wr-web for the fix.

## What Problem This Solves

Since 2026.11.5-beta.1, every skipped automation run writes this notice into the job's owner conversation:

> Automation "<name>" did not start: <reason> Check automation history, resolve the cause, then run it again.

That includes scheduled deferrals that need no fixing: a tick outside the job's active hours, or an idle-only run deferred while the agent is busy. For heartbeat-style jobs whose session target is the agent's own main session, the notice lands in the session the next run executes in. The next announced reply repeats it, and the copies multiply every cycle. The reporter saw 163 Slack messages in about 25 minutes, each with up to 26 copies.

## User Impact

Active-hours and busy deferrals no longer post a "did not start" notice, so they no longer feed the next run. Run history still records them as skipped with the same summary, and completion webhooks are unchanged. Other unstarted outcomes keep the notice: preparation or admission errors, and skips without a deferral reason.

## Why This Change Was Made

The executor already classifies these outcomes with `admissionDeferredReason` (timer-execution.ts). Finalization now forwards that fact in the transient CronEventContext, next to `runNotStarted` and `quietTrigger`; it is not projected into the public CronEvent. The notifier skips the conversation notice when the reason is present. No new classifier, wording, setting or stored state.

## Evidence

Real Gateway from source (`ocx src`), isolated state, deterministic local Responses provider that records every model request. A heartbeat job (every 1h, session target `session:agent:main:main`, active hours excluding now) is run three times, then its active hours are cleared and it runs once more (the next in-hours run). Control: a second job in the same session with `skipIfScratchEmpty` and an explicitly empty scratch, which skips without a deferral reason.

| | main 5e677ba | this PR a0b0a95 |
| --- | --- | --- |
| 3 active-hours runs | skipped, "Outside this automation's active hours" | same |
| "did not start" notices in the session | 3 | 0 |
| copies of the notice in the next run's model input | 3 | 0 |
| control: scratch-empty skip notice | written (3 -> 4) | written (0 -> 1) |

Raw output from both runs: #194276 (comment)

- `src/gateway/server-cron-notifications.test.ts`: the existing conversation-outcome table gains active-hours and busy rows that expect no conversation commit while the completion webhook is still sent. Both rows fail on main and pass here (29/29). Test lines net 0.
- Production change: +12 lines across three files, no deletions.
- The contributor's earlier Windows proof (isolated source Gateway, CLI `cron run --wait`) showed the same result: the notice in the main session's transcript tables on main, none with this change.

Merge danger: two-way door. A revert restores the old notices; nothing is stored or migrated. Blast radius: owner-conversation notices for skipped cron runs only.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 4b0d39b)

Co-authored-by: RomneyDa <[email protected]>
obviyus added a commit that referenced this pull request Nov 20, 2026
…"did not start" notices (#202390)

Root cause: src/cron/service/timer-execution.ts:220 (and its twin in src/cron/session-run.ts:224) returns `status: "skipped"` when `skipIfScratchEmpty` finds an explicitly empty checklist, and every skipped run is a failure downstream: `resolveCronCompletionStatus` maps skipped to `completionStatus: "failed"`, run storage records it as failed, it counts toward skipped-run alerts, and the Gateway posts "did not start" for any skipped run without an admission-deferral reason.

Fixes #202350. Thanks @herosuncy for the clear report and repro.

## What Problem This Solves

A heartbeat-style automation with "Skip empty scratch" on and the default comments-only checklist skips every interval, as intended. But each skip is recorded as a failed run, and the owner conversation gets `Automation "heartbeat-main" did not start: Automation scratch is explicitly empty. Check automation history, resolve the cause, then run it again.` every 30 minutes. An idle heartbeat looks broken, and the only workaround was disabling it.

## User Impact

An empty checklist now completes quietly: run history shows `status: "ok"`, `completionStatus: "succeeded"` and the same summary `Automation scratch is explicitly empty`, the model is still not called, no "did not start" notice is posted, and it no longer counts toward skipped-run alerts. Real start failures (for example a model that is not configured) still record a failed run and still post the notice.

## Why This Change Was Made

The skip is a deliberate "nothing to do" decision, not a failed start. The cron outcome model has no non-failure skipped state, but it already has one for a run that completes with nothing to deliver: `status: "ok"` with a delivery suppression reason (the same outcome a heartbeat turn with nothing to report records). Both empty-scratch producers now return that outcome with the existing `"empty"` suppression reason, so completion, storage, failure alerts and the conversation notice all treat it as a quiet completion through their existing rules. The primary webhook already ignored skips that never started (#200032); its guard now ignores any non-error run that never started, so the empty-checklist summary is still not POSTed as output. No new status, field, wording or stored shape.

Behavior notes: `lastRunStatus` for these ticks is `ok` instead of `skipped`, and `consecutiveSkipped` no longer grows. A one-shot (`at`) job with `deleteAfterRun` and an empty checklist is now deleted like any other succeeded one-shot instead of being kept disabled; it was already consumed and never replayed.

History: the skipped return came with the Doctor heartbeat migration (ec5d369, #179387). It predates the "did not start" notice, and #194276 only kept the empty-scratch notice as an untouched control while fixing active-hours/busy deferrals, so recording it as a failure was never a product decision.

## Evidence

Real Gateway from source (`ocx src`), isolated state, deterministic local Responses provider that logs every model request, and a process-local Gateway clock stepped past each due time (the system clock is untouched). Job from the issue: every 30 min, `sessionTarget: session:agent:main:main`, `skipIfScratchEmpty: true`, scratch = the issue's comments-only template.

| | main e99e848 | this PR 0519148 |
| --- | --- | --- |
| 2 scheduled ticks of heartbeat-main | `skipped` / `failed` x2 | `ok` / `succeeded` x2, same summary |
| job state | `consecutiveSkipped: 2` | `consecutiveSkipped: 0` |
| "did not start" notices in the session | 0 -> 2 | 0 -> 0 |
| model requests during the ticks | 1 -> 1 | 1 -> 1 |
| control: checklist with a real item | runs the turn (`ok`/`succeeded`, model called) | same |
| control: model override on an unconfigured provider | `error`/`failed` + "did not start" notice | same |

Observed output: #202390 (comment)

- `src/cron/service.runs-one-shot-main-job-disables-it.test.ts`: the existing scratch-empty one-shot case now asserts `ok`/`succeeded` history and no skip counter; it fails on main and passes here.
- `src/cron/service.trigger-eval.test.ts`: the existing webhook case still proves no POST for the empty checklist.
- Production: +7/-4 lines in three files. Tests: +9/-4 (the one regression).

Merge danger: two-way door. Nothing is migrated; a revert restores skipped/failed recording for later ticks, and rows written meanwhile stay `ok`/`succeeded`. Blast radius: automations with `skipIfScratchEmpty` and an empty checklist (run history status, completion, notices, skip alerts, `deleteAfterRun` one-shots).

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 21, 2026
…"did not start" notices (openclaw#202390)

Root cause: src/cron/service/timer-execution.ts:220 (and its twin in src/cron/session-run.ts:224) returns `status: "skipped"` when `skipIfScratchEmpty` finds an explicitly empty checklist, and every skipped run is a failure downstream: `resolveCronCompletionStatus` maps skipped to `completionStatus: "failed"`, run storage records it as failed, it counts toward skipped-run alerts, and the Gateway posts "did not start" for any skipped run without an admission-deferral reason.

Fixes openclaw#202350. Thanks @herosuncy for the clear report and repro.

## What Problem This Solves

A heartbeat-style automation with "Skip empty scratch" on and the default comments-only checklist skips every interval, as intended. But each skip is recorded as a failed run, and the owner conversation gets `Automation "heartbeat-main" did not start: Automation scratch is explicitly empty. Check automation history, resolve the cause, then run it again.` every 30 minutes. An idle heartbeat looks broken, and the only workaround was disabling it.

## User Impact

An empty checklist now completes quietly: run history shows `status: "ok"`, `completionStatus: "succeeded"` and the same summary `Automation scratch is explicitly empty`, the model is still not called, no "did not start" notice is posted, and it no longer counts toward skipped-run alerts. Real start failures (for example a model that is not configured) still record a failed run and still post the notice.

## Why This Change Was Made

The skip is a deliberate "nothing to do" decision, not a failed start. The cron outcome model has no non-failure skipped state, but it already has one for a run that completes with nothing to deliver: `status: "ok"` with a delivery suppression reason (the same outcome a heartbeat turn with nothing to report records). Both empty-scratch producers now return that outcome with the existing `"empty"` suppression reason, so completion, storage, failure alerts and the conversation notice all treat it as a quiet completion through their existing rules. The primary webhook already ignored skips that never started (openclaw#200032); its guard now ignores any non-error run that never started, so the empty-checklist summary is still not POSTed as output. No new status, field, wording or stored shape.

Behavior notes: `lastRunStatus` for these ticks is `ok` instead of `skipped`, and `consecutiveSkipped` no longer grows. A one-shot (`at`) job with `deleteAfterRun` and an empty checklist is now deleted like any other succeeded one-shot instead of being kept disabled; it was already consumed and never replayed.

History: the skipped return came with the Doctor heartbeat migration (b2a65a8, openclaw#179387). It predates the "did not start" notice, and openclaw#194276 only kept the empty-scratch notice as an untouched control while fixing active-hours/busy deferrals, so recording it as a failure was never a product decision.

## Evidence

Real Gateway from source (`ocx src`), isolated state, deterministic local Responses provider that logs every model request, and a process-local Gateway clock stepped past each due time (the system clock is untouched). Job from the issue: every 30 min, `sessionTarget: session:agent:main:main`, `skipIfScratchEmpty: true`, scratch = the issue's comments-only template.

| | main 704d0b3 | this PR 0519148 |
| --- | --- | --- |
| 2 scheduled ticks of heartbeat-main | `skipped` / `failed` x2 | `ok` / `succeeded` x2, same summary |
| job state | `consecutiveSkipped: 2` | `consecutiveSkipped: 0` |
| "did not start" notices in the session | 0 -> 2 | 0 -> 0 |
| model requests during the ticks | 1 -> 1 | 1 -> 1 |
| control: checklist with a real item | runs the turn (`ok`/`succeeded`, model called) | same |
| control: model override on an unconfigured provider | `error`/`failed` + "did not start" notice | same |

Observed output: openclaw#202390 (comment)

- `src/cron/service.runs-one-shot-main-job-disables-it.test.ts`: the existing scratch-empty one-shot case now asserts `ok`/`succeeded` history and no skip counter; it fails on main and passes here.
- `src/cron/service.trigger-eval.test.ts`: the existing webhook case still proves no POST for the empty checklist.
- Production: +7/-4 lines in three files. Tests: +9/-4 (the one regression).

Merge danger: two-way door. Nothing is migrated; a revert restores skipped/failed recording for later ticks, and rows written meanwhile stay `ok`/`succeeded`. Blast radius: automations with `skipIfScratchEmpty` and an empty checklist (run history status, completion, notices, skip alerts, `deleteAfterRun` one-shots).

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
openclaw#194276)

Root cause: src/gateway/server-cron-notifications.ts:581 treats every skipped run as "did not start", because src/cron/service/timer-outcome-finalization.ts:153 never forwards the executor's existing `admissionDeferredReason` ("active-hours" or "busy") in the transient CronEventContext, so expected deferrals are written into the owner conversation as failures.

Fixes openclaw#194261. Thanks @slatem for the detailed report and @wr-web for the fix.

## What Problem This Solves

Since 2026.11.5-beta.1, every skipped automation run writes this notice into the job's owner conversation:

> Automation "<name>" did not start: <reason> Check automation history, resolve the cause, then run it again.

That includes scheduled deferrals that need no fixing: a tick outside the job's active hours, or an idle-only run deferred while the agent is busy. For heartbeat-style jobs whose session target is the agent's own main session, the notice lands in the session the next run executes in. The next announced reply repeats it, and the copies multiply every cycle. The reporter saw 163 Slack messages in about 25 minutes, each with up to 26 copies.

## User Impact

Active-hours and busy deferrals no longer post a "did not start" notice, so they no longer feed the next run. Run history still records them as skipped with the same summary, and completion webhooks are unchanged. Other unstarted outcomes keep the notice: preparation or admission errors, and skips without a deferral reason.

## Why This Change Was Made

The executor already classifies these outcomes with `admissionDeferredReason` (timer-execution.ts). Finalization now forwards that fact in the transient CronEventContext, next to `runNotStarted` and `quietTrigger`; it is not projected into the public CronEvent. The notifier skips the conversation notice when the reason is present. No new classifier, wording, setting or stored state.

## Evidence

Real Gateway from source (`ocx src`), isolated state, deterministic local Responses provider that records every model request. A heartbeat job (every 1h, session target `session:agent:main:main`, active hours excluding now) is run three times, then its active hours are cleared and it runs once more (the next in-hours run). Control: a second job in the same session with `skipIfScratchEmpty` and an explicitly empty scratch, which skips without a deferral reason.

| | main 5e677ba | this PR a0b0a95 |
| --- | --- | --- |
| 3 active-hours runs | skipped, "Outside this automation's active hours" | same |
| "did not start" notices in the session | 3 | 0 |
| copies of the notice in the next run's model input | 3 | 0 |
| control: scratch-empty skip notice | written (3 -> 4) | written (0 -> 1) |

Raw output from both runs: openclaw#194276 (comment)

- `src/gateway/server-cron-notifications.test.ts`: the existing conversation-outcome table gains active-hours and busy rows that expect no conversation commit while the completion webhook is still sent. Both rows fail on main and pass here (29/29). Test lines net 0.
- Production change: +12 lines across three files, no deletions.
- The contributor's earlier Windows proof (isolated source Gateway, CLI `cron run --wait`) showed the same result: the notice in the main session's transcript tables on main, none with this change.

Merge danger: two-way door. A revert restores the old notices; nothing is stored or migrated. Blast radius: owner-conversation notices for skipped cron runs only.

Co-authored-by: Ayaan Zaidi <[email protected]>

(cherry picked from commit 4b0d39b)

Release adaptation: No prerequisite; conflict in finalization combines reason propagation with unrelated durableNextRunAtMsByJobId map absent in candidate. Take only reason propagation, not that map or scheduler refactor.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…"did not start" notices (#202390)

Root cause: src/cron/service/timer-execution.ts:220 (and its twin in src/cron/session-run.ts:224) returns `status: "skipped"` when `skipIfScratchEmpty` finds an explicitly empty checklist, and every skipped run is a failure downstream: `resolveCronCompletionStatus` maps skipped to `completionStatus: "failed"`, run storage records it as failed, it counts toward skipped-run alerts, and the Gateway posts "did not start" for any skipped run without an admission-deferral reason.

Fixes #202350. Thanks @herosuncy for the clear report and repro.

## What Problem This Solves

A heartbeat-style automation with "Skip empty scratch" on and the default comments-only checklist skips every interval, as intended. But each skip is recorded as a failed run, and the owner conversation gets `Automation "heartbeat-main" did not start: Automation scratch is explicitly empty. Check automation history, resolve the cause, then run it again.` every 30 minutes. An idle heartbeat looks broken, and the only workaround was disabling it.

## User Impact

An empty checklist now completes quietly: run history shows `status: "ok"`, `completionStatus: "succeeded"` and the same summary `Automation scratch is explicitly empty`, the model is still not called, no "did not start" notice is posted, and it no longer counts toward skipped-run alerts. Real start failures (for example a model that is not configured) still record a failed run and still post the notice.

## Why This Change Was Made

The skip is a deliberate "nothing to do" decision, not a failed start. The cron outcome model has no non-failure skipped state, but it already has one for a run that completes with nothing to deliver: `status: "ok"` with a delivery suppression reason (the same outcome a heartbeat turn with nothing to report records). Both empty-scratch producers now return that outcome with the existing `"empty"` suppression reason, so completion, storage, failure alerts and the conversation notice all treat it as a quiet completion through their existing rules. The primary webhook already ignored skips that never started (#200032); its guard now ignores any non-error run that never started, so the empty-checklist summary is still not POSTed as output. No new status, field, wording or stored shape.

Behavior notes: `lastRunStatus` for these ticks is `ok` instead of `skipped`, and `consecutiveSkipped` no longer grows. A one-shot (`at`) job with `deleteAfterRun` and an empty checklist is now deleted like any other succeeded one-shot instead of being kept disabled; it was already consumed and never replayed.

History: the skipped return came with the Doctor heartbeat migration (ec5d369, #179387). It predates the "did not start" notice, and #194276 only kept the empty-scratch notice as an untouched control while fixing active-hours/busy deferrals, so recording it as a failure was never a product decision.

## Evidence

Real Gateway from source (`ocx src`), isolated state, deterministic local Responses provider that logs every model request, and a process-local Gateway clock stepped past each due time (the system clock is untouched). Job from the issue: every 30 min, `sessionTarget: session:agent:main:main`, `skipIfScratchEmpty: true`, scratch = the issue's comments-only template.

| | main e99e848 | this PR 0519148 |
| --- | --- | --- |
| 2 scheduled ticks of heartbeat-main | `skipped` / `failed` x2 | `ok` / `succeeded` x2, same summary |
| job state | `consecutiveSkipped: 2` | `consecutiveSkipped: 0` |
| "did not start" notices in the session | 0 -> 2 | 0 -> 0 |
| model requests during the ticks | 1 -> 1 | 1 -> 1 |
| control: checklist with a real item | runs the turn (`ok`/`succeeded`, model called) | same |
| control: model override on an unconfigured provider | `error`/`failed` + "did not start" notice | same |

Observed output: #202390 (comment)

- `src/cron/service.runs-one-shot-main-job-disables-it.test.ts`: the existing scratch-empty one-shot case now asserts `ok`/`succeeded` history and no skip counter; it fails on main and passes here.
- `src/cron/service.trigger-eval.test.ts`: the existing webhook case still proves no POST for the empty checklist.
- Production: +7/-4 lines in three files. Tests: +9/-4 (the one regression).

Merge danger: two-way door. Nothing is migrated; a revert restores skipped/failed recording for later ticks, and rows written meanwhile stay `ok`/`succeeded`. Blast radius: automations with `skipIfScratchEmpty` and an empty checklist (run history status, completion, notices, skip alerts, `deleteAfterRun` one-shots).

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit ccc83c7)

Operator-requested 2026.11.10 stable backport (Dallin, 2026-11-24 04:15). Clean apply. Later main mentions: none.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

2 participants