Repository navigation
fix(cron): keep unroutable reports out of execution errors - #168380
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThe 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests +41, Docs +2. Total +47 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 6:20 AM ET / 10:20 UTC (Revision 2). |
|
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 |
|
Landed in 18b46dd. Unroutable cron announcements no longer count as execution errors; before/after CLI and Telegram evidence is in the PR body. |
…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]>
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"andcompletionStatus: "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:--announce, repeated twiceerror/ completionfailed, execution streak 1ok/ completionfailed, execution streak 0--no-delivercontrolok/succeeded, streak 0ok/failed, streak 0All announcement runs retained
REPORT_COMPLETE; candidate retained the unresolved-channel delivery diagnostic.cron run --wait --json,cron runs, andcron getwere 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 acrossrun.meta-error-status.test.tsanddelivery-dispatch.double-announce.test.ts(82.52 s wrapper wall time). Candidate production build passed. A real OpenAIgpt-5-minicron turn also retainedREPORT_COMPLETEwith executionok, completionfailed, and execution streak 0.Telegram Test Server: a real isolated cron announcement completed with
runStatus: "ok"; the QA user received the mock provider'sOPENCLAW_E2E_OKmessage. 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
782f4435e9d964b6bceb485acc6f13ec15d99a33and marked review state ready. CI run 38043813032 stopped on the unrelatedsession-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.