Skip to content

fix(cron): webhook automations POST skip text when a run skips before it starts - #200032

Merged
hannesrudolph merged 2 commits into
openclaw:mainfrom
daniel-lxs:fix-cron-webhook-skip-before-start
Nov 17, 2026
Merged

hannesrudolph merged 2 commits into
openclaw:mainfrom
daniel-lxs:fix-cron-webhook-skip-before-start

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Closes #200030

What Problem This Solves

Fixes: an automation with webhook delivery POSTs a "finished" event carrying skip text ("Automation admission deferred by its current window or foreground activity", "Automation scratch is explicitly empty") as its summary when the run skipped before it started, most visibly when a trigger fires while the agent is busy.

User Impact

Webhook receivers get a POST only when a run actually executed (or failed). A run that skipped before execution, with or without a fired trigger, sends nothing and records deliveryStatus: "not-requested". Skip reasons stay in automation history.

Behavior change: skipped runs no longer POST to the job's primary webhook (delivery.mode: "webhook"). Integrations that need skip events can read them from run history (openclaw automations runs or cron.runs), set failureAlert.includeSkipped: true to get a failure alert after repeated skips, or use announce delivery with a delivery.completionDestination webhook, which this change does not affect.

Why This Change Was Made

The primary webhook already skips deferred admissions, but its check reuses a scheduling predicate that ignores any run with a trigger result (a fired trigger spends the occurrence, so scheduling must not retry it). That is right for scheduling and wrong for delivery: the run still has no output. The webhook skips every result that is skipped with executionStarted: false. That covers the trigger case and other skips before execution, such as an empty scratch. Scheduling and run finalization keep using the existing predicate unchanged.

Evidence

Tests in src/cron/service.trigger-eval.test.ts, run against the real cron service harness:

  • A trigger fires, the isolated run defers its admission: no webhook call, the finished event is skipped with triggerFired: true, and the trigger counts once.
  • A non-trigger run skips on an empty scratch: no webhook call, the skip text stays in the finished event.
  • A trigger fires and the run returns output (ok), or fails before it starts (error with executionStarted: false): one webhook call carrying that status and its summary or error.

Without the change, the first two fail at sendCronWebhook being called once (with status: "skipped" and the skip text as summary). With it, all pass. The third guards against a check that is too broad: without the skipped status condition the error case fails, and skipping every run after a fired trigger fails both cases. Output and error delivery without a trigger are covered by the existing optional-output cases in the same file and the busy-deferral tests in src/cron/service.session-payload.test.ts, which deliver the run's output once the agent is idle.

Nearby cron suites with the change: 14 files, 218 tests pass (trigger evaluation, session payload, restart delivery, persisted delivery status, failure alerts, delivery plan, manual delivery, cross-tick admission, jobs, timer outcomes, webhook interruption, batch finalization, trigger timer, command timeout). src/cron/cron-delivery-outcomes.e2e.test.ts passes 5 of 6: "applies threshold and cooldown once before transporting execution failure alerts" fails the same way on unmodified main (2 of 2 runs), on failure-alert message text for an errored run, which this change does not touch.

Typecheck (tsconfig.core.json and the cron test config), oxlint, oxfmt, git diff --check and the test-line budget (+85 of 400) on the touched files pass.

Live run on an isolated local Gateway (built from main d275ff6, then with this change), with a throwaway HTTP receiver as the webhook target (allowed through cron.webhookSsrfPolicy.allowedHostnames: ["127.0.0.1"]). One isolated agent-turn automation with skipIfScratchEmpty: true and webhook delivery, created with cron.add, scratch emptied with cron.scratch.set, run with cron.run in force mode:

Build Scratch Receiver got Run record
main empty POST /hook with status: "skipped", summary: "Automation scratch is explicitly empty" deliveryStatus: "delivered"
this change empty nothing skipped, same summary, deliveryStatus: "not-requested"
this change "Check the build queue" stand-in model call, then POST /hook with status: "ok", summary: "Build queue is clear." deliveryStatus: "delivered"

The third row shows a run that executes still delivers its output. The trigger-fires-while-busy deferral is covered by the first regression test: reproducing it on a Gateway needs the agent to turn busy between the preflight check and the run start.

… it starts

The primary webhook skipped deferred admissions through a scheduling
predicate that ignores runs with a trigger result, so a deferral after a
fired trigger, and other skips before execution such as an empty
scratch, were POSTed with their skip text as the summary. Skip every
result that is skipped with executionStarted false.

Closes openclaw#200030
@clawsweeper

clawsweeper Bot commented Nov 16, 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.

@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. P2 Normal backlog priority with limited blast radius. 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Suppress webhook delivery for runs explicitly skipped before execution while retaining their skip reasons in history.

Example: An automation uses skipIfScratchEmpty=true and webhook delivery with empty scratch.

  • Before: The receiver gets a POST containing “Automation scratch is explicitly empty,” and history records delivered.
  • After: No POST is sent, and history retains the skip reason with deliveryStatus="not-requested".

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with concrete reported Gateway results, distinct regression coverage, and successful exact-head gates.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The contributor reports before/after results through an isolated Gateway and real HTTP receiver: empty-scratch skips stop sending POSTs and retain not-requested history, while executed output still delivers; fired-trigger deferral has complementary cron-service regression coverage.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Webhook consumers receive scheduler skip reasons as automation output even though the payload never executed.
Reason: The repair restores delivery semantics using existing execution facts without adding settings, APIs, or competing ownership.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it provides a minimal fix for a current webhook delivery bug, with useful regression coverage and no actionable findings.

Priority: P2
Reviewed head: 6c9088f1f17d13620a3ff46801b742c755b21ace

Before merge

None.

Findings

None.

Agent review details

How this fits together

The cron runner receives execution outcomes, decides whether primary webhook delivery is requested, and passes execution and delivery facts to run finalization.

flowchart TD
  A[Scheduled or manual run] --> B[Cron execution]
  B --> C[Execution outcome]
  C --> D[Primary webhook decision]
  D --> E[HTTP receiver]
  D --> F[Run finalization and history]
Loading

Technical review

Best possible solution:

Use explicit pre-execution skip facts at the existing webhook boundary while preserving scheduling, history, actual output, and error delivery.

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

Current-main source establishes both paths: fired-trigger outcomes bypass the scheduling predicate, and empty-scratch skips do not qualify as admission deferrals; the contributor also supplies concrete Gateway receiver results.

Is this the best way to solve the issue?

This is the smallest complete repair: change the delivery decision in its existing owner, retain the scheduling predicate for scheduling, and cover suppression plus output/error controls without new machinery.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Primary webhook suppression keeps the original intent (ec5d369: The heartbeat-to-Automations migration kept deferred admissions pending and suppressed their webhook delivery; the PR preserves that intent while separating delivery eligibility from occurrence retry policy.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Verified introduced change: The pinned introduction diff replaces the scheduling-specific deferral predicate with an explicit skipped-before-execution check; the remaining additions exercise suppression and continued output/error delivery. (src/cron/service/timer-job-runner.ts:82, 6c9088f1f17d)
  • Current-main defect remains: Fetched main still calls isDeferredCronAdmission before webhook delivery, while that predicate excludes outcomes carrying triggerEval and requires admissionDeferred=true, leaving fired-trigger deferrals and empty-scratch skips eligible for POST. (src/cron/service/timer-job-runner.ts:82, 60c112a1bfa9)
  • Original intent and feature history: The migration commit added webhook suppression for deferred admissions to preserve pending occurrences; the original webhook implementation and subsequent delivery repairs establish Peter Steinberger and Josh Avant as relevant feature-history owners. An extended follow-history lookup encountered unavailable old blobs, but the responsible introduction and current-main lines were readable. (src/cron/service/timer-job-runner.ts:82, ec5d369a6f66)
  • Supplied Gateway behavior evidence: The PR body reports an isolated Gateway and real HTTP receiver: empty scratch POSTs on the base, sends nothing with the fix, and records not-requested; nonempty scratch executes through a stand-in model and still delivers output. (6c9088f1f17d)
  • Related work has a different boundary: fix: stop expected automation skips from posting did-not-start notices #194276 suppresses conversation notices for expected admission deferrals and explicitly leaves webhooks unchanged; its inspected terminal screenshot does not prove this PR's webhook behavior. The paired report Automation webhook POSTs skip text as output when a run skips before it starts #200030 describes the exact defect addressed here.
  • Exact-head checks and mergeability: The reviewed head has successful openclaw/ci-gate and PR context checks, successful security-sensitive and dependency-review statuses, and GitHub reports mergeable=true with clean mergeability. (6c9088f1f17d)

PR surface

Source 0, Tests +85. Total +85 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 2 2 0
Tests 1 85 0 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 87 2 +85

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: #200030
Summary: This PR addresses the paired webhook report; the conversation-notice PR concerns a separate downstream effect.

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:

  • P2: Webhook consumers can mistake pre-execution skip reasons for automation results, with limited impact outside affected automations.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 (1 earlier review cycle)
  • reviewed 2026-11-16T08:39:54.286Z sha 8586272 :: needs maintainer review before merge. :: none

Reviewed November 16, 2026, 9:06 AM ET / 14:06 UTC (Revision 2).

…fires

Covers the cases a too-broad skip check would drop: a fired trigger
followed by real output, and an error from a run that never started.
@daniel-lxs

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@hannesrudolph
hannesrudolph merged commit 7b0a97a into openclaw:main Nov 17, 2026
127 of 128 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
… it starts (openclaw#200032)

* fix(cron): webhook automations POST skip text when a run skips before it starts

The primary webhook skipped deferred admissions through a scheduling
predicate that ignores runs with a trigger result, so a deferral after a
fired trigger, and other skips before execution such as an empty
scratch, were POSTed with their skip text as the summary. Skip every
result that is skipped with executionStarted false.

Closes openclaw#200030

* test(cron): webhook still delivers output and errors after a trigger fires

Covers the cases a too-broad skip check would drop: a fired trigger
followed by real output, and an error from a run that never started.
RomneyDa added a commit that referenced this pull request Nov 19, 2026
… it starts (#200032)

* fix(cron): webhook automations POST skip text when a run skips before it starts

The primary webhook skipped deferred admissions through a scheduling
predicate that ignores runs with a trigger result, so a deferral after a
fired trigger, and other skips before execution such as an empty
scratch, were POSTed with their skip text as the summary. Skip every
result that is skipped with executionStarted false.

Closes #200030

* test(cron): webhook still delivers output and errors after a trigger fires

Covers the cases a too-broad skip check would drop: a fired trigger
followed by real output, and an error from a run that never started.

(cherry picked from commit 7b0a97a)

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
… it starts (openclaw#200032)

* fix(cron): webhook automations POST skip text when a run skips before it starts

The primary webhook skipped deferred admissions through a scheduling
predicate that ignores runs with a trigger result, so a deferral after a
fired trigger, and other skips before execution such as an empty
scratch, were POSTed with their skip text as the summary. Skip every
result that is skipped with executionStarted false.

Closes openclaw#200030

* test(cron): webhook still delivers output and errors after a trigger fires

Covers the cases a too-broad skip check would drop: a fired trigger
followed by real output, and an error from a run that never started.

(cherry picked from commit 7b0a97a)

Release adaptation: None. Apply before 4b0d39b for easy cron review, though files do not overlap.

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

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automation webhook POSTs skip text as output when a run skips before it starts

2 participants