fix(cron): preserve enabled-with-defaults failure alert through store roundtrip (fixes #96589) (AI-assisted)#96601
Conversation
… roundtrip
failureAlertFromRow returned undefined when failure_alert_disabled was 0
(enabled-with-defaults) and all explicit config columns were null. This
caused resolveFailureAlert to treat the job as having no alert config,
silencing failure notifications after a gateway restart.
Add row.failure_alert_disabled !== 0 to the empty-column guard so the
enabled sentinel survives the SQLite round-trip as {}.
Fixes openclaw#96589
|
Codex review: needs maintainer review before merge. Reviewed June 24, 2026, 8:20 PM ET / 00:20 UTC. Summary PR surface: Source +1, Tests +55. Total +56 across 2 files. Reproducibility: yes. at source level: encode Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow codec/test fix after maintainer review and CI, then close #96589 as fixed. Do we have a high-confidence way to reproduce the issue? Yes at source level: encode Is this the best way to solve the issue? Yes. The writer already encodes AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 0a14444924e3. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +55. Total +56 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
@clawsweeper automerge |
|
ClawSweeper 🐠 reef update Thanks for the work here. ClawSweeper could not write to the source branch, so it opened a replacement PR rather than letting the fix drift. attribution still points back here. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: reasoning high; reviewed against bd9b2a1. |
What Problem This Solves
Enabling cron failure alerts with defaults only (
openclaw cron edit <job> --failure-alertwith no--failure-alert-*flags) works until the next gateway restart, then silently stops firing forever. The store codec persists the enabled-with-defaults state but cannot read it back, so on reload the job'sfailureAlertbecomesundefinedand failing jobs fail invisibly.Why This Change Was Made
failureAlertFromRowinsrc/cron/store/failure-alert-codec.tschecks whether all explicit config columns are null to decide if there is no alert config. But whenfailure_alert_disabled === 0(the enabled-with-defaults sentinel), all explicit columns are also null, so the empty-check returnsundefinedinstead of{}. This collapses three intended states (disabled / enabled-with-defaults / populated) into two on read.The fix adds
row.failure_alert_disabled !== 0to the empty-column guard so the enabled sentinel survives the SQLite round-trip.User Impact
Operators who enable per-job failure alerts with default settings will no longer silently lose alert coverage after a gateway restart. This is a data-roundtrip correctness fix with no config surface or behavioral change for alerts that were already configured with explicit fields.
Evidence
{}) collapses toundefinedon SQLite store roundtrip, silencing alerts after gateway restart.0a042f68.bindFailureAlertColumnsandfailureAlertFromRowfromsrc/cron/store/failure-alert-codec.tswith tsx.roundtrip({})now returns{}(truthy, alert active) instead ofundefined(falsy, alert silenced). TheresolveFailureAlertfunction atsrc/cron/service/failure-alerts.ts:75will proceed with defaults whenjobConfigis{}.Real behavior proof
{}) collapses toundefinedon SQLite store roundtrip, silencing alerts after gateway restart.0a042f68.bindFailureAlertColumnsandfailureAlertFromRowfromsrc/cron/store/failure-alert-codec.tswith tsx.Observed result after fix:
roundtrip({})now returns{}(truthy, alert active) instead ofundefined(falsy, alert silenced). TheresolveFailureAlertfunction atsrc/cron/service/failure-alerts.ts:75will proceed with defaults whenjobConfigis{}.What was not tested: Live gateway restart cycle (requires full gateway orchestration); the fix is validated at the codec layer where the bug resides.
AI-assisted (Hermes Agent)