Skip to content

fix(cron): preserve successful silent automation runs - #154533

Merged
obviyus merged 2 commits into
mainfrom
fix/cron-silent-completion
Sep 21, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/cron-silent-completion

Conversation

@obviyus

@obviyus obviyus commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #110565

What Problem This Solves

Fixes announced automations being treated as missing replies when they intentionally have nothing to report.

User Impact

User impact: scheduled jobs can finish silently without an unwanted recovery answer or a false missing-payload error. Direct user messages still require a reply. Execution failures, cancellations, failed child handoffs, and transport errors remain failures.

Why This Change Was Made

An announce destination selects where an automation's output goes; it does not require output on every run. Both CLI and embedded execution now receive the same optional-reply contract. The cron finalizer consumes the runtime outcome instead of independently classifying empty output as failure.

This restores the documented automation contract without changing configuration, stored jobs, tool permissions, or retry budgets. It does not interpret an assistant's prose as proof that an arbitrary task succeeded.

Evidence

  • The same announced NO_REPLY job failed on baseline 6beea0a8521: two provider requests followed by incomplete_turn. Its test job was removed and runner cleanup completed.
  • 130 focused tests passed in 61.04 seconds wall time across cron completion, CLI reply hooks, and embedded terminal resolution; 98 CLI-policy and fallback-classification tests also passed in 57.01 seconds wall time after cleanup. Coverage includes required direct-user NO_REPLY recovery, optional silence, provider/tool errors, cancellation, failed child handoffs, and delivery errors.
  • Telegram Test Server, leased real-user recorder, isolated Gateway at 8ffdf068593: an announced cron returning NO_REPLY completed with runStatus: ok, one provider request, and zero SUT messages. The job was removed and runner scratch cleaned up.
  • Direct-user control on the same candidate: the model first returned NO_REPLY; recovery made one continuation request and Telegram showed exactly one CRON_REPLY_HUMAN_OK message. Utility recaps were disabled in this isolated fixture so the injected silence reached the user turn, not background work.
  • Full build, scoped type-aware lint, both full dead-code scans, formatting, and whitespace checks passed. Production code shrank by 43 lines. The follow-up only inlines an unchanged internal predicate and removes an obsolete test assertion; it does not change the Telegram-tested behavior.

@clawsweeper

clawsweeper Bot commented Sep 21, 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 size: S maintainer Maintainer-authored PR labels Sep 21, 2026
@obviyus
obviyus marked this pull request as ready for review September 21, 2026 06:54
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 3:29 AM ET / 07:29 UTC (Revision 3).

ClawSweeper review

What this changes

The PR lets scheduled agent runs finish successfully without a reply by sharing an optional-reply contract across both runners and removing cron’s separate empty-output rejection.

Merge readiness

✅ Ready for maintainer review

The fix remains necessary and has no actionable findings. The prior CLI assertion is corrected, and the requested test timings are now recorded; no additional contributor action remains from this review.

Priority: P2
Reviewed head: 90bde4c9e3ed7f04314c531298a92dc2f1e8ef2a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable fix with relevant before/after transport proof and resolved prior review requests.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Recorded Telegram Test Server observations exercise cron execution and finalization: successful NO_REPLY produces no message and no recovery request, while the direct-user control still recovers one reply. The inspected follow-up preserves the tested behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): Recorded Telegram Test Server observations exercise cron execution and finalization: successful NO_REPLY produces no message and no recovery request, while the direct-user control still recovers one reply. The inspected follow-up preserves the tested behavior.
Evidence reviewed 8 items Pinned introduced change: Reviewed the merge-base-to-head delta at the supplied original head. Base-branch drift was excluded, and the stale test merge was not used to infer removals.
Current main still needs the repair: Fetched main still sets terminalReplyExpectation to required for a resolved announce destination. Its three affected production files match the pinned merge-base versions, so the proposed correction remains distinct.
Latest release retains the required-reply override: The executor at the supplied v2026.9.5 release commit also requires a terminal reply for resolved announce delivery; this release does not contain the proposed correction.
Findings None None.
Security None None.

How this fits together

OpenClaw’s automation scheduler sends scheduled prompts through CLI or embedded agent execution. Cron then records the execution outcome and delivers available output to the configured destination.

flowchart TD
  A[Scheduled job] --> B[Cron execution]
  B --> C[Optional reply contract]
  C --> D[CLI or embedded agent]
  D --> E[Execution outcome]
  E --> F[Record failures or successful silence]
  E --> G[Deliver available output]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -43, Tests -20. Total -63 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 3 46 -43
Tests 3 18 38 -20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 21 84 -63

Review metrics

None.

Technical review

Best possible solution:

Keep reply requiredness with the input owner, allowing successful scheduled silence while preserving execution failures and delivery accounting.

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

Yes: current main’s resolved announce path overrides optional silence with a required reply, matching the recorded baseline failure. This review verified the source path without executing a fresh reproduction.

Is this the best way to solve the issue?

Yes: the patch uses the existing shared reply contract and removes a competing cron check without adding configuration or changing stored jobs.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded Telegram Test Server observations exercise cron execution and finalization: successful NO_REPLY produces no message and no recovery request, while the direct-user control still recovers one reply. The inspected follow-up preserves the tested behavior.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs false failures and unwanted recovery replies for scheduled jobs that intentionally produce no output.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): Recorded Telegram Test Server observations exercise cron execution and finalization: successful NO_REPLY produces no message and no recovery request, while the direct-user control still recovers one reply. The inspected follow-up preserves the tested behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded Telegram Test Server observations exercise cron execution and finalization: successful NO_REPLY produces no message and no recovery request, while the direct-user control still recovers one reply. The inspected follow-up preserves the tested behavior.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Suppressing unwanted scheduled replies is Telegram-visible; the supplied Test Server evidence already covers it.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head delta at the supplied original head. Base-branch drift was excluded, and the stale test merge was not used to infer removals. (90bde4c9e3ed)
  • Current main still needs the repair: Fetched main still sets terminalReplyExpectation to required for a resolved announce destination. Its three affected production files match the pinned merge-base versions, so the proposed correction remains distinct. (src/cron/isolated-agent/run-executor.ts:686, 69afbbaf3742)
  • Latest release retains the required-reply override: The executor at the supplied v2026.9.5 release commit also requires a terminal reply for resolved announce delivery; this release does not contain the proposed correction. (src/cron/isolated-agent/run-executor.ts:817, ec9c1a13db89)
  • Established silent automation contract: Automation documentation explicitly treats NO_REPLY and intentionally empty output as successful suppression, without claiming delivery or triggering delivery-failure alerts. Public docs: docs/automation/cron-jobs/managing-jobs.md. (docs/automation/cron-jobs/managing-jobs.md:155, 90bde4c9e3ed)
  • Shared policy and failure preservation: The common runner arguments now select optional replies. The existing reply-policy owner gives explicit expectations precedence; cron finalization retains abort, fatal execution error, child-handoff, and delivery-error handling. This changes OpenClaw’s host reply policy without changing a Codex-specific protocol or dependency contract. (src/cron/isolated-agent/run-executor.ts:483, 90bde4c9e3ed)
  • Real behavior evidence and follow-up equivalence: The captured PR body records baseline failure with two provider requests and incomplete_turn, followed by Telegram Test Server success at 8ffdf06: runStatus ok, one provider request, and zero messages. A direct-user control recovered exactly one CRON_REPLY_HUMAN_OK reply. The inspected follow-up only inlines the unchanged completion predicate and removes the obsolete CLI assertion, preserving that proof’s behavioral scope. (90bde4c9e3ed)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: 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 (2 earlier review cycles)
  • reviewed 2026-09-21T07:01:51.554Z sha 8ffdf06 :: needs changes before merge. :: [P2] Update the CLI announce test to the explicit reply contract
  • reviewed 2026-09-21T07:18:13.732Z sha 90bde4c :: needs changes before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Sep 21, 2026
@obviyus

obviyus commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

Added the measured wall times to the PR Evidence section: 61.04 seconds for the initial 130 focused tests, and 57.01 seconds for the 98 follow-up CLI-policy/fallback tests. Both include wrapper and worker preparation. No source changes or performance claims were added.

@obviyus

obviyus commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

CI attempt 1 on 90bde4c had the migration-heartbeat failure in checks-node-compact-small-3, plus four cancelled shards (large-5, small-13, large-9, large-14). The initial failure-only summary omitted those cancellations. I requested cancellation of the partial retry and will run one complete validation attempt so no cancelled required work is treated as passed. No source, test expectations, or timeout budgets changed.

@clawsweeper clawsweeper Bot added 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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 21, 2026
@obviyus

obviyus commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

CI attempt 3 finished on 90bde4c9e3ed7f04314c531298a92dc2f1e8ef2a with no cancelled jobs and two failed source jobs:

  • Native Codex output-fidelity fixture: two cases failed with Expected native command execution in job 106250386007. This fixture drives a standalone Codex app-server against a local mock provider with no dynamic tools. The failure reads the native commandExecution notification at lines 238–249, before constructing OpenClaw's projector at line 278; it does not execute the changed cron executor/finalizer. Both cases passed in attempt-1 job 106244812555.
  • Migrated-updater fixture: four finalization cases hit their unchanged 30-second test timeout in job 106250388522. These exercise schema/update finalization in a fresh worker, not an agent-turn cron. All nine rows passed in attempt-1 job 106244815431; the four affected rows took 2.94–3.42 seconds then.

The logs for both attempts pin the identical actual checkout and workflow commit, c5247e7ee498f4f702924aa68f7d647e1271271a (merge of this head into 807e2eed920e2b0fa1678428976a94a36d0f5098). This is not merely an event-head comparison. The remaining production change in the shared fallback classifier is the literal same predicate inlined at its sole remaining use.

The automatic recent-main fingerprint matcher found no exact matches; I am not claiming that it proved these failures base-red or claiming their precise environmental cause. The scoped exception rests on the inspected disjoint execution paths and the exact same-checkout passing evidence above. All other applicable jobs completed successfully or were intentionally skipped. Cron's focused tests, dead-code scans, real Telegram baseline/candidate/control proof, and exact-head review passed. No test expectations, timeout budgets, sandbox settings, or unrelated migration code were changed to make these failures disappear.

Using the maintainer workflow's explicit unrelated-red record for these two jobs only, under the existing repair-and-land authorization. The final CI run remains reported as red, not green.

@obviyus

obviyus commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 154533
head: 90bde4c
run: 35571681280 attempt: 3
failed: checks-node-changed-extensions-bundle-20 job=106250386007 conclusion=failure
failed: checks-node-compact-small-28 job=106250388522 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit f17f50a into main Sep 21, 2026
530 of 546 checks passed
@obviyus
obviyus deleted the fix/cron-silent-completion branch September 21, 2026 08:23
@obviyus

obviyus commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator Author

Merged as f17f50a. Scheduled NO_REPLY now completes silently without an unnecessary recovery turn; direct-user NO_REPLY still recovers exactly one visible reply. Verified through real Telegram Test Server baseline/candidate/control runs, 228 focused tests across the two validation batches, scoped lint, and both dead-code scans. The two unrelated native/updater CI failures and their identical-checkout passing evidence are documented above; the full run was not reported green. No production Gateway, job configuration, or credentials were changed.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
Related: openclaw#110565

## What Problem This Solves

Fixes announced automations being treated as missing replies when they intentionally have nothing to report.

## User Impact

User impact: scheduled jobs can finish silently without an unwanted recovery answer or a false missing-payload error. Direct user messages still require a reply. Execution failures, cancellations, failed child handoffs, and transport errors remain failures.

## Why This Change Was Made

An announce destination selects where an automation's output goes; it does not require output on every run. Both CLI and embedded execution now receive the same optional-reply contract. The cron finalizer consumes the runtime outcome instead of independently classifying empty output as failure.

This restores the documented automation contract without changing configuration, stored jobs, tool permissions, or retry budgets. It does not interpret an assistant's prose as proof that an arbitrary task succeeded.

## Evidence

- The same announced `NO_REPLY` job failed on baseline `c7725c10b87`: two provider requests followed by `incomplete_turn`. Its test job was removed and runner cleanup completed.
- 130 focused tests passed in **61.04 seconds wall time** across cron completion, CLI reply hooks, and embedded terminal resolution; 98 CLI-policy and fallback-classification tests also passed in **57.01 seconds wall time** after cleanup. Coverage includes required direct-user `NO_REPLY` recovery, optional silence, provider/tool errors, cancellation, failed child handoffs, and delivery errors.
- Telegram Test Server, leased real-user recorder, isolated Gateway at `8ffdf068593`: an announced cron returning `NO_REPLY` completed with `runStatus: ok`, one provider request, and zero SUT messages. The job was removed and runner scratch cleaned up.
- Direct-user control on the same candidate: the model first returned `NO_REPLY`; recovery made one continuation request and Telegram showed exactly one `CRON_REPLY_HUMAN_OK` message. Utility recaps were disabled in this isolated fixture so the injected silence reached the user turn, not background work.
- Full build, scoped type-aware lint, both full dead-code scans, formatting, and whitespace checks passed. Production code shrank by 43 lines. The follow-up only inlines an unchanged internal predicate and removes an obsolete test assertion; it does not change the Telegram-tested behavior.

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 maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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