fix: stop expected automation skips from posting did-not-start notices (#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 5e677bad858c | this PR a0b0a959d097 |
| --- | --- | --- |
| 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: https://github.com/openclaw/openclaw/pull/194276#issuecomment-6970544767
- `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 <hi@obviy.us>
fix: stop expected automation skips from posting did-not-start notice…
Find Your Interest
- Android Perfetto 系列 5:Android App 基于 Choreographer 的渲染流程
- Android 基于 Choreographer 的渲染机制详解
- Android Perfetto 系列 8:深入理解 Vsync 机制与性能分析
- Android Systrace 基础知识 - SystemServer 解读
- This Week In Security: Four-Digit Patch Tuesday, SSH Exploited, GitBook Breach, Android GhostMap
- Android Perfetto 系列 15:Boot Trace、长时间现场 Trace 与偶发问题抓取
- Android Systrace 基础知识 - Vsync 解读
- Android Perfetto 系列 10:Binder 调度与锁竞争
- Android 性能优化之 Systrace 工具介绍(一)
- Android Perfetto 系列 7:MainThread 和 RenderThread 解读





