Repository navigation
fix(cron): keep one-shot finalization working on PostgreSQL 16 - #194384
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review — final head 606d784. Focus on PG16 bound JSON conversion, SQLite JSON subtype preservation, and the unchanged schema boundary. Focused PostgreSQL 16/17/18 cron tests and SQLite JSON tests pass; current proof and limitations are in the PR body. |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR makes cron enablement JSON writes portable to PostgreSQL 16, accepts PostgreSQL 18 EXPLAIN formatting, and corrects conformance documentation. Example: A retained one-shot job named one-shot finishes successfully on PostgreSQL 16 with deleteAfterRun=false.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it repairs a current PostgreSQL 16 cron failure through the existing database-expression owner, with no introduced correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCron finalization sends runtime state and enablement changes to the transactional row writer, which uses engine-owned JSON expressions to update SQLite or PostgreSQL. flowchart LR
A[Cron execution outcome] --> B[Finalization worker]
B --> C[Runtime row mutation]
C --> D[Cron row writer]
D --> E[Engine JSON expressions]
E --> F[SQLite or PostgreSQL]
Technical reviewBest possible solution: Keep JSON parsing in the existing engine-expression owner and retain the current transactional cron write and regression coverage. Do we have a high-confidence way to reproduce the issue? Current-main source exposes the unconditional json(...) call, and the existing database regression reaches it during retained one-shot finalization; no target code was executed during this review. Is this the best way to solve the issue? The patch fixes the invalid expression at its existing engine boundary, preserves SQLite JSON subtype handling, and avoids changing shared scalar-extraction semantics. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 638a1851e7e6. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +14, Tests 0, Docs +1, Other 0. Total +15 across 5 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 HistoryReviewed November 6, 2026, 8:57 PM ET / November 7, 2026, 01:57 UTC (Revision 3). |
|
@clawsweeper re-review — final head e24ebd1. Runtime files are unchanged from the reviewed/tested patch. Final test-value review restores the original JSON unit file and relies on the existing actual cron regression, already passed on PostgreSQL 16/17/18 and SQLite; net test growth is zero. Final local autoreview is complete with no actionable P0-P2 findings. Updated evidence and remaining limits are in the PR body. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review — final head 98bfbca. The completed baseline found only two failures: the repaired PG16 cron JSON expression and PG18 fractional EXPLAIN row formatting. The latter is now a one-line test-only repair retaining exact rows, loops, canonical-index and no-full-scan checks. Existing cache suite passed 6/6 on each PG16/17/18; cron passed 2/2 per major including SQLite. Fresh final local autoreview is complete with no actionable P0-P2 findings. Runtime files and schema embargo are unchanged; updated proof and limits are in the PR body. |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
…law#194384) * docs: clarify PostgreSQL conformance coverage * fix(cron): keep one-shot finalization working on PostgreSQL 16 * test(database): reuse cron conformance for JSON conversion regression * test(postgres): accept fractional explain row counts
…law#194384) * docs: clarify PostgreSQL conformance coverage * fix(cron): keep one-shot finalization working on PostgreSQL 16 * test(database): reuse cron conformance for JSON conversion regression * test(postgres): accept fractional explain row counts (cherry picked from commit 7ab0143) Release adaptation: Only engine-owned jsonValue and retained cron enabled JSON replacement; preserve native boolean type with PG16 explicit ::json and SQLite json(). Omit unrelated PG docs/EXPLAIN test edits; retained one-shot enabled-transition caller present on baseline. Follow-up dispositions: e029e18 docs: document isolated PostgreSQL restore drills (openclaw#202704); 49f0740 fix(database): report disabled memory after a port (openclaw#202630); a80b564 fix: keep database workers healthy after silent connection loss (openclaw#201856); 3d91af2 fix(config): reject reserved PostgreSQL schema prefixes (openclaw#202097); 835d722 fix: catch incompatible ownership before porting to SQLite (openclaw#202101); 67796a6 fix: keep scheduled Git backups current on PostgreSQL (openclaw#201870); cc849dd fix: recover lease heartbeats after a PostgreSQL connection loss (openclaw#201858); 6594caf fix: prepare macOS runtime pins without the PostgreSQL secret (openclaw#202102); 6ca56cd docs: clarify PostgreSQL storage and backup coverage (openclaw#202086); a079190 fix(postgres): chat history slows under concurrent reads (openclaw#190129); 2ff4256 feat(database): keep PostgreSQL rollback captures in PostgreSQL (openclaw#196236); 96c685b feat(backup): restore PostgreSQL stores into a staging database for restore drills (openclaw#194808); fb83d65 fix: reduce transcript allocation when preparing native context seeds; 71ec4d2 fix(config): keep Workboard PostgreSQL upgrades readable (openclaw#194648); b6ed907 perf(sessions): persist active transcript facts for hydration (openclaw#193682) Validation: Baseline cron generated json(bound text) on PostgreSQL where json(text) is unavailable; helper and focused boolean regression retained. Exact PostgreSQL16 server proof unavailable; focused SQLite/helper tests queued. diff check passed. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 38fdd9b52704d588d9ca24ef8e391d644961c985) (cherry picked from commit fb935e6912388314851b05cb698ef038b83bbd07)
What Problem This Solves
Fixes cron job finalization and enable/disable transitions failing on PostgreSQL 16 with
function json(unknown) does not exist. Also repairs the existing PostgreSQL 18 cache conformance assertion for fractional EXPLAIN row counts.User Impact
Retained one-shot jobs can finish, and cron jobs can change enabled state, while preserving authored configuration and unrelated JSON fields. No migration or operator action is required. Cache eviction behavior is unchanged.
Why This Change Was Made
The cron row writer passed bound JSON text through SQLite's
json(...)syntax on every engine. The database expression owner now parses serialized JSON with an explicit PostgreSQL cast and retains SQLite's JSON subtype behavior. The JSON path mutation helper stays unchanged, preserving scalar extraction behavior in session callers.The all-major baseline also exposed a test-only PG18 failure: the correct timestamp-index scan reports
rows=11.00instead ofrows=11. Accept zero fractional digits while retaining exactly eleven rows, one loop, the canonical index and no sequential scan. The loop boundary now also rejectsloops=10. PostgreSQL documents the fractional EXPLAIN output change.Correct the PostgreSQL guide's existing CI cadence and the index checker's stale runtime-admission comment.
No SQLite schema version, DDL, migration, persisted format, public API, SDK, config/default, protocol, durability, recovery, or retention-policy changes.
Production delta: +14 lines, justified by the internal engine-owned JSON conversion boundary; net test growth: zero (one existing assertion changed); prose/comments: +4/-3. Replaces the cron writer's unconditional SQLite function expression; adds no fallback or parallel storage path. The existing store-level regression catches the runtime defect; no duplicate helper tests are added.
Evidence
efb980423985b290f5c294ba7b13ad4c2bd074d8: seven of nine jobs passed. PG16: 1,511 passed, 1 failed, 40 skipped; its sole failure is the repaired cron regression. PG17: all three jobs passed, 1,512 tests passed, 40 skipped. PG18: 1,511 passed, 1 failed, 40 skipped; its sole failure is the repaired EXPLAIN assertion. Counts mix actual PostgreSQL, SQLite sibling and unit/mock cases; the baseline remains failed.cron-runtime-row.postgres.test.tspassed on PostgreSQL 16, 17 and 18, including its SQLite sibling each time: 2/2 tests per major. Covers retained one-shot finalization, true/false enablement, current scratch snapshots, queue reconciliation and opaque authored fields. Runtime file hashes remain unchanged in the final head.manager-embedding-cache.postgres.test.ts: all six tests passed on each of PG16/17/18. End-to-end runner wall time: 28.18s / 28.10s / 32.08s respectively; most time is worker compilation, actual cache test cases below one second per major. Retains bounded canonical-index eviction, composite identities, batching, rollback and preferred eviction coverage.json-values.test.ts: 3/3 passed, 1.61s runner wall; byte-for-byte unchanged from baseline. Retains scalar/opaque preservation, ordered projections and nested-array aggregation.efb9804, P0-P2: complete, no actionable findings. Independent owner/dependency/sibling, test-value and PG18 planner-contract reviews also completed. Kysely 0.29.7 emits named functions verbatim; the PG16 repair belongs in the engine expression owner.pnpm docs:list,git diff --checkand the zero-growth test-line ratchet passed. The single assertion edit preserves test line count; no existing tests, baseline or allocation were removed.98bfbca282cbe41fde4a72e0d91059c3dd65b44b, including all three full PG17 conformance shards. Exact-head build artifacts also passed. The final check rollup has 64 successes, 58 intentional skips, one neutral result and no failures. Earlier failed/cancelled runs remain recorded separately.Follow-ups: add a Gateway-level retained one-shot cron smoke on PG16 in PR CI; separately reconcile inherited one-line test-budget accounting debt in its CI owner. Neither changes this repair's schema boundary.