Skip to content

docs(cron): scope consecutive-failure wait to failure alerts - #162695

Merged
obviyus merged 2 commits into
mainfrom
cron-guidance-wording
Oct 2, 2026
Merged

obviyus merged 2 commits into
mainfrom
cron-guidance-wording

Conversation

@obviyus

@obviyus obviyus commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Follow-up to #160996. The cron authoring guidance (docs payloads.md and the automations tool description) said failure notifications wait for consecutive failed runs, "so a one-off outage stays quiet". That isn't true, so the guidance taught models a wrong cost for failing loudly:

  • A command payload with announce delivery still delivers its output when it exits non-zero: runCommandJob in src/gateway/server-cron.ts passes the summary to completion delivery without checking the exit status.
  • Since fix(cron): blocked scheduled runs are recorded as ok #162391, an agent's AUTOMATION_FAILED explanation is delivered for announce jobs.

Solution

Only the failure alert waits for consecutive failures; the run's own output still follows the job's delivery setting. Both places now say exactly that. The tool description stays static (prompt-cache stable) and grows by 12 characters. Prompt snapshots are regenerated.

User Impact

No runtime behavior change. Models writing automations get accurate guidance about what a failed run sends.

Evidence

The automations tool description an agent actually receives, taken from the regenerated prompt snapshot (codex-dynamic-tools.telegram-direct.json, built by the real prompt builder):

  • Before: throw from the script so the run records the failure (returning {error} still succeeds); failure alerts already wait for consecutive failures, so a one-off failure stays quiet.
  • After: throw from the script so the run records the failure (returning {error} still succeeds); only the failure alert waits for consecutive failures, run output still follows the job's delivery.

Checks on the exact head:

  • pnpm run prompt:snapshots:check: snapshots are current (7 files).
  • node scripts/run-vitest.mjs src/agents/tools/cron-tool.test.ts: 72 passed.

Text-only change, so no live channel proof applies: no message, delivery or runtime path changes.

Runtime output from a real OpenClaw setup on head 15919727aaa: the actual createCronTool() builder run in an isolated state dir (default config), printing the failure-guidance sentences of the automations tool description an agent receives:

tool: automations
When a run fails, throw from the script so the run records the failure (returning {error} still succeeds); only the failure alert waits for consecutive failures, run output still follows the job's delivery.
FAILURE ALERTS: jobs with a failure route default to alerting after 2 consecutive execution failures with a 1h cooldown.

The same sentence on origin/main read: …failure alerts already wait for consecutive failures, so a one-off failure stays quiet.

@clawsweeper

clawsweeper Bot commented Oct 1, 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.

@obviyus

obviyus commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: S labels Oct 1, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 1, 2026
@clawsweeper

clawsweeper Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 1, 2026, 9:06 PM ET / October 2, 2026, 01:06 UTC (Revision 6).

ClawSweeper review

What this changes

Clarifies automation documentation and agent tool guidance that consecutive-failure thresholds govern failure alerts while run output follows delivery settings, and refreshes prompt snapshots.

Merge readiness

✅ Ready for maintainer review

The correction remains necessary on current main. The wording matches the existing delivery behavior, the supplied runtime output covers the changed tool description, and no actionable patch defect remains.

Priority: P3
Reviewed head: 15919727aaa9367261db79b457cdec8d3a1e51b9

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct clarification with direct production-text output and matching snapshot updates.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The captured body shows the actual automation tool builder on the reviewed head printing the corrected description in an isolated OpenClaw setup. That output directly covers the changed production text; no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The captured body shows the actual automation tool builder on the reviewed head printing the corrected description in an isolated OpenClaw setup. That output directly covers the changed production text; no stored-data contract changes.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head diff changes authoring prose and corresponding prompt text, counts, and hashes. It introduces no execution, delivery, permission, configuration, or storage changes.
Correction still needed on main: Fetched main retains the assertion that a one-off failure stays quiet in both the tool description and payload documentation. The related merged PRs establish prior guidance and runtime behavior, rather than implementing this correction.
Output delivery is independent of execution status: The command-job runner passes captured summary text to completion announcement without requiring a successful execution status. Existing failure-notification documentation separately describes execution thresholds and cooldowns.
Findings None None.
Security None None.

How this fits together

OpenClaw's automation tool gives agents instructions for creating scheduled jobs. The scheduler separately handles each run's output delivery and threshold-based failure alerts.

flowchart TD
  A[Automation author] --> B[Docs and tool guidance]
  B --> C[Scheduled job]
  C --> D[Run outcome]
  D --> E[Configured output delivery]
  D --> F[Failure threshold and cooldown]
  F --> G[Failure notification]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source 0, Tests 0, Docs +1. Total +1 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 4 25 25 0
Docs 1 4 3 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 30 29 +1

Review metrics

Metric Value Why it matters
Model context cost Tool description +12 characters The clarification remains static and adds only a bounded amount of model-facing context.

Technical review

Best possible solution:

Keep automation authoring guidance consistent with the scheduler's separate output-delivery and failure-alert contracts.

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

Not applicable to a runtime defect: this PR corrects text. Current-main guidance and the existing completion-delivery path establish the contradiction directly.

Is this the best way to solve the issue?

Yes. Updating the existing documentation and static tool description is the narrowest repair, and the regenerated fixtures reflect the same correction.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured body shows the actual automation tool builder on the reviewed head printing the corrected description in an isolated OpenClaw setup. That output directly covers the changed production text; no stored-data contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦀 challenger crab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P3: This is a focused authoring-text correction with no scheduler or delivery behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The captured body shows the actual automation tool builder on the reviewed head printing the corrected description in an isolated OpenClaw setup. That output directly covers the changed production text; no stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body shows the actual automation tool builder on the reviewed head printing the corrected description in an isolated OpenClaw setup. That output directly covers the changed production text; no stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff changes authoring prose and corresponding prompt text, counts, and hashes. It introduces no execution, delivery, permission, configuration, or storage changes. (src/agents/tools/cron-tool.ts:198, 15919727aaa9)
  • Correction still needed on main: Fetched main retains the assertion that a one-off failure stays quiet in both the tool description and payload documentation. The related merged PRs establish prior guidance and runtime behavior, rather than implementing this correction. (src/agents/tools/cron-tool.ts:198, 4809de9b6add)
  • Output delivery is independent of execution status: The command-job runner passes captured summary text to completion announcement without requiring a successful execution status. Existing failure-notification documentation separately describes execution thresholds and cooldowns. (src/gateway/server-cron.ts:644, 15919727aaa9)
  • After-fix production text proof: The captured PR body reports running the actual createCronTool builder in an isolated OpenClaw setup on head 1591972 and includes its automations description with the corrected sentence and existing failure-alert defaults. This directly exercises the changed text owner; no changed transport behavior requires live channel proof. Reported snapshot checks and 72 passing tool tests are supplemental. (src/agents/tools/cron-tool.ts:237, 15919727aaa9)
  • Prior merged area work: Current-main history includes merged authoring guidance at feat(cron): teach the automations tool to script repeatable job logic #160996 and blocked-run handling at fix(cron): blocked scheduled runs are recorded as ok #162391. GitHub's commit API identifies obviyus as the author of the merged guidance commit and supplies its relevant source patch. (src/agents/tools/cron-tool.ts, b2bc8f05e707)
  • Implementation boundary: The changed description is built by OpenClaw's automation tool. Codex-named fixtures record that description, but the patch changes no Codex harness, runtime, schema, or protocol contract; dependency-specific Codex inspection is therefore unnecessary. (src/agents/tools/cron-tool.ts:185, 15919727aaa9)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-01T12:46:44.385Z sha c5c9e41 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-01T13:25:57.855Z sha c5c9e41 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-02T00:41:54.091Z sha 1591972 :: needs changes before merge. :: none
  • reviewed 2026-10-02T00:51:13.272Z sha 1591972 :: needs changes before merge. :: none
  • reviewed 2026-10-02T01:02:47.880Z sha 1591972 :: needs maintainer review before merge. :: none

@obviyus
obviyus force-pushed the cron-guidance-wording branch from c5c9e41 to 1591972 Compare October 2, 2026 00:37
@obviyus
obviyus marked this pull request as ready for review October 2, 2026 00:37
@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Oct 2, 2026
@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦀 challenger crab Exceptional PR readiness: strong proof, clean patch, and convincing validation. labels Oct 2, 2026
@obviyus
obviyus merged commit e993be8 into main Oct 2, 2026
191 of 218 checks passed
@obviyus
obviyus deleted the cron-guidance-wording branch October 2, 2026 01:08
@obviyus

obviyus commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as e993be8 on head 1591972. Text-only: the cron authoring guidance now says only the failure alert waits for consecutive failures, while the run's own output follows the job's delivery setting. ClawSweeper ready, CI green (the cancelled Security High jobs are the docs-only skip path), real tool-builder output in the PR body.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 2, 2026
…w#162695)

## What Problem This Solves

Follow-up to openclaw#160996. The cron authoring guidance (docs `payloads.md` and the automations tool description) said failure notifications wait for consecutive failed runs, "so a one-off outage stays quiet". That isn't true, so the guidance taught models a wrong cost for failing loudly:

- A command payload with announce delivery still delivers its output when it exits non-zero: `runCommandJob` in `src/gateway/server-cron.ts` passes the summary to completion delivery without checking the exit status.
- Since openclaw#162391, an agent's `AUTOMATION_FAILED` explanation is delivered for announce jobs.

## Solution

Only the failure alert waits for consecutive failures; the run's own output still follows the job's delivery setting. Both places now say exactly that. The tool description stays static (prompt-cache stable) and grows by 12 characters. Prompt snapshots are regenerated.

## User Impact

No runtime behavior change. Models writing automations get accurate guidance about what a failed run sends.

## Evidence

The automations tool description an agent actually receives, taken from the regenerated prompt snapshot (`codex-dynamic-tools.telegram-direct.json`, built by the real prompt builder):

- Before: `throw from the script so the run records the failure (returning {error} still succeeds); failure alerts already wait for consecutive failures, so a one-off failure stays quiet.`
- After: `throw from the script so the run records the failure (returning {error} still succeeds); only the failure alert waits for consecutive failures, run output still follows the job's delivery.`

Checks on the exact head:

- `pnpm run prompt:snapshots:check`: snapshots are current (7 files).
- `node scripts/run-vitest.mjs src/agents/tools/cron-tool.test.ts`: 72 passed.

Text-only change, so no live channel proof applies: no message, delivery or runtime path changes.


Runtime output from a real OpenClaw setup on head `15919727aaa`: the actual `createCronTool()` builder run in an isolated state dir (default config), printing the failure-guidance sentences of the `automations` tool description an agent receives:

```text
tool: automations
When a run fails, throw from the script so the run records the failure (returning {error} still succeeds); only the failure alert waits for consecutive failures, run output still follows the job's delivery.
FAILURE ALERTS: jobs with a failure route default to alerting after 2 consecutive execution failures with a 1h cooldown.
```

The same sentence on `origin/main` read: `…failure alerts already wait for consecutive failures, so a one-off failure stays quiet.`

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

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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.

1 participant