Skip to content

fix(cron): keep unroutable reports out of execution errors - #168380

Merged
obviyus merged 1 commit into
mainfrom
fix/cron-delivery-target-status
Oct 10, 2026
Merged

obviyus merged 1 commit into
mainfrom
fix/cron-delivery-target-status

Conversation

@obviyus

@obviyus obviyus commented Oct 10, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes successful isolated cron reports being recorded as execution errors when announcement delivery cannot resolve a channel, including Gateways with no configured channels.

User Impact

The report remains in history with execution status: "ok" and completionStatus: "failed". Delivery diagnostics remain visible, but delivery-only failures no longer increase execution-error streaks or trigger execution backoff. Routing admission and validation are unchanged.

Why This Change Was Made

Delivery-target failure must not replace the agent's execution outcome. Both finalization and delivery cleanup now distinguish it from execution failure. A genuinely failed agent turn still retains its execution error when delivery also fails. Existing delivery-failure notification policy remains responsible for alternate destinations, rather than the execution-error threshold.

No config, SDK, or stored-schema changes.

Evidence

Built Gateway and real CLI, baseline ab251835d1d3d7af16e2ddae5a40ce46f533db95, isolated state and no configured channels:

Case Baseline Candidate
--announce, repeated twice error / completion failed, execution streak 1 ok / completion failed, execution streak 0
--no-deliver control ok / succeeded, streak 0 unchanged
HTTP 503 webhook control ok / failed, streak 0 unchanged

All announcement runs retained REPORT_COMPLETE; candidate retained the unresolved-channel delivery diagnostic. cron run --wait --json, cron runs, and cron get were recorded for each case.

The new two-case regression fails on baseline: a successful agent is misclassified as error, and an actual agent failure is replaced by the delivery error. Candidate focused tests passed: 95 tests across run.meta-error-status.test.ts and delivery-dispatch.double-announce.test.ts (82.52 s wrapper wall time). Candidate production build passed. A real OpenAI gpt-5-mini cron turn also retained REPORT_COMPLETE with execution ok, completion failed, and execution streak 0.

Telegram Test Server: a real isolated cron announcement completed with runStatus: "ok"; the QA user received the mock provider's OPENCLAW_E2E_OK message. The runner removed the cron job and released its lease. Both Gateway and cron CLI ran against the built candidate in Docker.

Hosted ClawSweeper found no actionable defects on 782f4435e9d964b6bceb485acc6f13ec15d99a33 and marked review state ready. CI run 38043813032 stopped on the unrelated session-dashboard.e2e.test.ts “Pin to dashboard” pointer-interception failure; the same case is recorded in doctor-only #59414 and #168312. The diff cannot reach this mocked UI test. 21 remaining jobs were cancelled, not product-test failures.

Two-way door: reverting restores the previous classification without data migration. Blast radius is isolated cron jobs whose required announcement target cannot resolve; ordinary sends, webhook behavior, routing validation, and genuinely failed executions retain their contracts.

@clawsweeper

clawsweeper Bot commented Oct 10, 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 10, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Oct 10, 2026
@obviyus
obviyus marked this pull request as ready for review October 10, 2026 10:07
@clawsweeper clawsweeper Bot added 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. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The PR keeps unresolved announcement destinations from replacing an isolated cron run’s execution outcome.

Example: An isolated cron job produces REPORT_COMPLETE with announcement delivery enabled and no configured channels.

  • Before: Execution is recorded as error, completion fails, and the execution-error streak increases.
  • After: Execution is recorded as ok, completion still fails, and the report and delivery diagnostic remain available without execution backoff.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct repair with reported shipped-entry-point results and meaningful regression coverage; the proof is presented as summarized observations rather than attached raw traces.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied built-Gateway and real-CLI comparison exercises unresolved announcement delivery through cron run, runs, and get, reporting retained REPORT_COMPLETE output, execution ok, completion failed, and a zero execution-error streak; no-delivery and webhook controls remain unchanged.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A completed automation report can be labeled an execution error and back off solely because its announcement destination cannot resolve.
Reason: The change restores the documented execution/delivery distinction and preserves the original agent failure when both execution and delivery fail.

Merge readiness

✅ Ready for maintainer review

This PR fixes a concrete cron classification bug still present on current main. No actionable patch defects were found; the unrelated dashboard CI failure remains outside this change.

Priority: P2
Reviewed head: 782f4435e9d964b6bceb485acc6f13ec15d99a33

Before merge

None.

Findings

None.

Agent review details

How this fits together

The isolated cron finalizer combines agent execution results with dispatcher delivery facts; the scheduler consumes those separate outcomes for history, backoff, alerts, and cleanup.

flowchart TD
  A[Cron job] --> B[Isolated agent execution]
  B --> C[Run finalizer]
  C --> D[Delivery dispatcher]
  D --> E[Announcement destination]
  D --> C
  C --> F[Scheduler outcome handling]
  F --> G[History and backoff]
Loading

Technical review

Best possible solution:

Land the focused classification repair while preserving failed delivery completion, routing checks, and genuine execution errors.

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

Current-main source directly shows delivery-target errors overriding execution status; the contributor supplies a matching baseline CLI reproduction, but this read-only review ran no target code.

Is this the best way to solve the issue?

The patch repairs classification at the existing finalizer and cleanup owners without relaxing destination validation or introducing another outcome owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Final execution-result classification changes intended behavior with a stated reason (bfa2970: The merged completion-ownership refactor centralized final result construction and claimed behavior preservation; this PR explains the narrower correction to delivery-target precedence.)
  • Delivery cleanup classification keeps the original intent (2f4d475: Prior work retained failed delegated executions and classified settled child answers; the patch preserves that behavior while excluding delivery-target failures from execution failure.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +4, Tests +41, Docs +2. Total +47 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 13 9 +4
Tests 1 41 0 +41
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 56 9 +47

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Unroutable isolated announcements incorrectly affect execution status and backoff; the report remains recoverable and the affected path is bounded.
  • 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 need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-10T10:11:41.038Z sha 782f443 :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 6:20 AM ET / 10:20 UTC (Revision 2).

@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Maintainer override: after replaying the failed and cancelled jobs, every selected job is green except checks-ui-e2e (1/2), the session-dashboard pin cases where chat-gutter-stack intercepts the Pin to dashboard click (https://github.com/openclaw/openclaw/actions/runs/38043813032/job/114190215639). The identical failure appears on unrelated PRs #59414 and #167996, and #168312, #168345 and #167789 landed with this override. This cron-only change can't reach that mocked UI test; ClawSweeper is ready on this exact head.

@obviyus
obviyus merged commit 18b46dd into main Oct 10, 2026
234 of 260 checks passed
@obviyus
obviyus deleted the fix/cron-delivery-target-status branch October 10, 2026 10:46
@obviyus

obviyus commented Oct 10, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in 18b46dd. Unroutable cron announcements no longer count as execution errors; before/after CLI and Telegram evidence is in the PR body.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…168380)

An isolated cron agent job with --announce on a Gateway with no reachable channel recorded a successful run as an execution error and incremented consecutiveErrors, because the delivery-target failure disposition replaced the agent's execution outcome. A delivery-target failure now keeps execution status ok and records completion failed, matching the webhook delivery path and docs/cli/cron.md; the report stays in run history. Found by our cron bug hunt.

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

docs Improvements or additions to documentation 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.

1 participant