Repository navigation
feat(cron): include run time in failure alerts - #80246
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 30, 2026, 12:18 AM ET / 04:18 UTC. ClawSweeper reviewWhat this changesThe branch carries each failed or skipped cron run’s start time into chat failure alerts and adds it as an optional Merge readinessKeep this PR open for normal maintainer landing review. The current head has focused implementation and test coverage, the recorded maintainer contract accepts optional additive Priority: P2 Review scores
Verification
How this fits togetherCron service records each job result and decides whether its failure policy should emit an alert. The Gateway then formats chat delivery in the agent’s user timezone or sends a webhook payload to an external integration. flowchart LR
A[Cron job run] --> B[Completed run result]
B --> C[Failure alert policy]
C --> D[Gateway failure delivery]
D --> E[Chat alert in user timezone]
D --> F[Webhook JSON payload]
B --> G[Cooldown bookkeeping]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +26, Tests +181, Docs +4. Total +211 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Mantis proof suggestionA fresh Telegram Desktop capture would supplement the exact-head webhook proof by showing the localized run-start line in the user-visible chat alert. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the focused timestamp propagation with the additive webhook contract intact: chat uses the agent user timezone, webhook consumers receive optional Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request; the exact-head packaged-runtime scenario did demonstrate the changed cron failure delivery path through an external webhook. Is this the best way to solve the issue? Yes. Carrying the recorded run start as a separate fact preserves cooldown semantics, localizes only the chat presentation, and avoids breaking existing webhook message consumers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b2136fa23486. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
c762489 to
24b8ee8
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Clockwork Patch Peep Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
|
@clawsweeper re-review Current-head real delivery proof is now in the PR body. The exact CI-built runtime delivered a redacted failure webhook whose |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
b37f59d to
f9aa28c
Compare
Co-authored-by: haishmg <[email protected]>
f9aa28c to
9d415c8
Compare
|
@clawsweeper re-review Current-head proof and CI provenance are now in the PR body for |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|


Closes #77497.
What Problem This Solves
Cron failure alerts can arrive after a delay, making an old failure look current when the notification only shows its delivery time.
Why This Change Was Made
Failure alert delivery now carries the run's start time as a separate fact from alert cooldown bookkeeping. Chat notifications append that instant in the agent's configured user timezone; webhook message text remains unchanged and exposes the instant as structured
runAtMs.The rewrite deliberately does not use the cron schedule timezone, rewrite webhook message strings, or reuse the run start time as the alert occurrence time.
Maintainer contract decision: accept
runAtMsas an additive optional failure-webhook field. Existingmessagebytes remain stable, no existing field changes meaning, and webhook consumers should ignore unknown JSON properties.User Impact
Operators can tell when a failed or skipped cron run actually started, even when its chat alert is delivered later. Existing webhook consumers keep the same
messagetext and can opt into the additiverunAtMsfield.Evidence
git diff --check: passed.{ "surface": "cron failure notifications", "result": "pass", "chat": "run start appended in agents.defaults.userTimezone", "webhook": "message text unchanged; runAtMs added as structured data", "cooldown": "still anchored to alert occurrence time", "missingRunAtMs": "legacy notification text preserved" }Real Behavior Proof
9d415c85f2f93f74d08a3053ddb120b2c5c58dd9, rebased ontocc48aef143551af2ce13096264335ce9954e61e6.885da07020e96cb6b6c78e2a20ea722e964399b8; its parents are basecc48aef143551af2ce13096264335ce9954e61e6and exact PR head9d415c85f2f93f74d08a3053ddb120b2c5c58dd9.failureAlert.after=1, zero cooldown, webhook mode, and normal delivery disabled, then ran it withcron run --wait.runAtMs=1785383461252.fe51ab55-3e45-4260-b361-a4b6988aee20received the failure-alert POST. The deliveredrunAtMsexactly matched the completed run's value.messageretained its legacy bytes while the optional numeric field was added:{ "jobId": "<redacted>", "jobName": "9d415c85 exact-head external failure alert proof", "message": "Cron job \"9d415c85 exact-head external failure alert proof\" failed 1 times\nLast error: command exited with code 7", "runAtMs": 1785383461252 }2026-01-15 10:30 ESTfor a2026-01-15T15:30:00Zrun withagents.defaults.userTimezone=America/New_York; the historical Telegram before/after recording remains in the PR discussion.