Repository navigation
fix(cron): finalize retained one-shot jobs on PostgreSQL - #181802
Conversation
Use the engine-owned JSON mutation when cron completion disables a retained one-shot. Preserve boolean enablement and authored config while atomically publishing terminal history.
|
🦞👀 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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR uses engine-aware JSON mutation when cron runtime updates enable or disable a job. Example: A PostgreSQL-backed one-shot job named one-shot finishes successfully with deleteAfterRun: false.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a concrete PostgreSQL failure still present on current main, preserves the existing cron storage contract, and introduces no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCron execution outcomes enter the existing transactional finalization worker, which updates job runtime state and run history through the shared row codec and database-engine SQL helpers. flowchart TD
A[Cron execution outcome] --> B[Finalization worker]
B --> C[Runtime row mutation]
C --> D[Cron row codec]
D --> E[Engine JSON helper]
E --> F[SQLite or PostgreSQL]
B --> G[Run history]
Technical reviewBest possible solution: Retain the focused helper substitution and its cross-engine finalization regression. Do we have a high-confidence way to reproduce the issue? Current-main source directly exposes the SQLite-only call during retained one-shot finalization, matching the reported PostgreSQL 42883 failure; this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete repair: reuse the existing dialect owner while preserving the transaction, enablement policy, and authored fields. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6cc605dfe204. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +3, Tests +148. Total +151 across 2 files. Added test files: 1. View PR surface stats
LabelsLabel 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 Reviewed October 23, 2026, 2:06 PM ET / 18:06 UTC. |
|
Merged via squash.
|
…1802) Use the engine-owned JSON mutation when cron completion disables a retained one-shot. Preserve boolean enablement and authored config while atomically publishing terminal history.
Use the engine-owned JSON mutation when cron completion disables a retained one-shot. Preserve boolean enablement and authored config while atomically publishing terminal history. Beta.5 adaptation: Apply the source behavior to the c11c9d3 baseline; preserve baseline-native producer/consumer seams and include focused regression and registration adaptations for this group. See expanded-implementation-0/receipts.json for closure and qualification. (cherry picked from commit e96c704) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 820bb0a3d96397d6d71fec318137bd335939bb24)
What Problem This Solves
Fixes retained one-shot cron jobs remaining marked as running on PostgreSQL after the model finishes successfully.
User Impact
Scheduled one-shot jobs with
deleteAfterRun: falsenow publish their terminal result and become disabled, while their authored configuration stays intact.Why This Change Was Made
The enablement transition called SQLite's
json_setdirectly. Reuse the existing engine-aware JSON mutation helper so PostgreSQL usesjsonb_setand both engines retain JSON booleans. This changes no schema, locking, transaction, or public configuration contract. Production delta: +5/-2; the regression adds 148 lines to cover durable finalization and reenabling on both engines.Evidence
A real Gateway with a real model reproduced PostgreSQL error
42883after successful model execution. The regression fails on unchanged main for that same reason while SQLite passes; it passes on both engines with this fix. Twelve existing cron tests also pass, as do the core and infra-test type checks. Independent Codex P0–P2 autoreview is clean.On final head
14193c8663ce803eaa5a478624be6c90b8131a6f, real-model scheduled execution passes on both PostgreSQL and SQLite: terminal history is published, the retained job is disabled, history is readable, and removal succeeds. All three PostgreSQL conformance shards and the full required CI passed in run 39998434582. The additional local Homebrew PostgreSQL 17 conformance run also passed all three shards on the same head: 1,130 tests passed, 39 source-declared skips, and zero failures; pgvector, pg_trgm, and unaccent cases executed.