Repository navigation
fix: qualify PostgreSQL majors and repair stable adoption - #178005
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. |
Avoid supplementing known store paths with their canonical aliases. Released updaters otherwise mistake duplicate shared and local stores for agent databases after candidate activation. Keep explicitly registered spellings and snapshot coverage intact.
c981595 to
50e01a4
Compare
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. |
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50e01a442f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!target || !input) { | ||
| refuse(ctx, "credential binding without shared target", "captured shared store"); | ||
| } | ||
| rebindPortedClientCredentials({ |
There was a problem hiding this comment.
Keep startup blocked until credential rebinding is durable
If the process exits after the manifest revision is durably marked complete but before this rebinding commits, assertDatabasePortStartupAllowed permits the next Gateway startup even though the canonical credential receipt still references the pre-port shared-store inode. assertClientCredentialStoreReady then rejects that receipt, leaving local credentials unusable until the operator discovers and manually resumes the port. Keep the manifest startup-blocking until the receipt update is durable, while still preventing rollback once rebinding begins.
AGENTS.md reference: AGENTS.md:L9-L11
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesRepairs stable SQLite-to-PostgreSQL adoption and documents qualification for PostgreSQL 16–18. Example: An OpenClaw 2026.10.5 installation updates and ports populated stores to PostgreSQL 17.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR repairs a concrete PostgreSQL adoption path, but credential finalization leaves an interrupted port incorrectly marked ready for startup. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe installed updater inventories and captures existing databases; the offline port command migrates verified copies, publishes stores and configuration, and updates the local credential receipt used by subsequent client admission. flowchart TD
A[Installed updater] --> B[Database inventory and captures]
B --> C[Offline port owner]
C --> D[Private migration copy]
D --> E[Published database stores]
C --> F[Local credential owner]
E --> G[Gateway and client startup]
F --> G
Technical reviewBest possible solution: Keep credential-bearing port manifests startup-blocking until rebinding and archival finish, while preserving the existing prohibition on rollback after completion. Do we have a high-confidence way to reproduce the issue? Source and the added failure-injection case establish the trigger: a receipt-write failure leaves a complete manifest and an old shared-file binding; no target code was executed during this read-only review. Is this the best way to solve the issue? The alias, canonical-root, private journal migration, and credential-owner changes address the reported causes without parallel ownership; the remaining correction belongs in the existing port startup/recovery contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a56638bd7334. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +209, Tests +309, Docs +78, Generated 0, Other +11. Total +607 across 15 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 20, 2026, 12:08 AM ET / 04:08 UTC. |
|
Merged via squash.
|
…78005) ## What Problem This Solves Fixes the published-stable SQLite → current → PostgreSQL adoption path, which could duplicate aliased stores, silently omit the port source, reject a valid lazy journal column, or leave local credentials bound to the old database. Qualifies PostgreSQL 16–18 with recorded full conformance runs. ## User Impact Existing 2026.10.5 users can update through their installed updater, port their populated stores to PostgreSQL, and start the Gateway with their agents, sessions, memory, and local credentials intact. The docs state the tested scope: foreground macOS acceptance, no live inference without provider keys, and service activation covered separately by the signed-Mac/Parallels lane. Published 2026.10.5 has no PostgreSQL configuration schema, so a native stable-PG upgrade is not applicable. ## Why This Change Was Made Use physical identity to deduplicate supplemental updater discovery while preserving explicit registry spellings. Take the port's canonical state root from its existing owner. Complete the lazy deletion-journal column only in the private migration copy. Capture credential receipt metadata with the existing port artifacts and rebind it through the credential owner after durable port completion, preserving the local credential rows and provenance. No new schema, migration protocol, or readiness bypass. The simplification pass retained the existing owners and removed duplicate alias discovery. Delta: +249/−29 production lines, +326/−17 test lines, +128/−50 documentation lines. PostgreSQL 18 rejects malformed JSON before its CHECK constraint in one catalog probe; accept either rejection while retaining strict row-rejection assertions. No CI matrix was added. A weekly sequential PG16/PG18 conformance job is recommended to catch future major-version differences without adding per-PR cost. ## Evidence - Final-head [CI run 39366445588](https://github.com/openclaw/openclaw/actions/runs/39366445588): all three PostgreSQL conformance shards and `openclaw/ci-gate` passed on `50e01a442f95b9c75baca485e4b352d7b2427079`. - `PGQUAL-MAJORS-UPGRADE`, local Homebrew PostgreSQL 16.15_1 / 17.11_1 / 18.6_1, unaccent 1.1, pg_trgm 1.6, pgvector 0.8.7. Full unsharded CI entry point on 16 and 18. Counts, source heads, bottle/source SHA256s, lock sizing, and the retained initial failures are in [the qualification record](docs/gateway/postgresql.md#server-major-qualification). - PG16 full: 948 passed / 2 failed / 37 skipped; the three affected files passed once on PG16 and PG17 (10 tests each). PG18 full: 947 passed / 3 failed / 37 skipped; failed files passed on PG17 (9 tests) and PG18 with port/recovery (43 tests). Further PG18 journal regression: 25/25. Initial timeout/cleanup failures are not represented as clean full runs. - Published stable installed-updater run `d3b04126-11d3-4f28-9dd0-146f9fe914b5`: exited 0 and activated the exact packed build `b1d415c2448f`. PostgreSQL port `aae1aaff-ec7e-4dac-afe6-7b46f8589867`: two populated stores, retained SQLite captures, foreground Gateway readiness, agent/session/memory continuity, Doctor/status. Unreachable-DSN Doctor returned exit 2 and `ok: false`. Matching pre-upgrade backup + exact stable package rollback passed the same continuity checks. [Cell table](docs/gateway/postgresql.md#published-stable-upgrade-qualification). - Regressions reproduced before their fixes. Final PG17 credential/port/recovery/restore run: 46/46. Final PG18 credential/port/recovery run on integrated head `50e01a442f95`: 40/40, including all five credential cases. Core and scripts typechecks, targeted infrastructure/updater test typechecks, lint/format, docs checks, and independent P0–P2 review recorded locally. Full test-graph selection encountered pre-existing 725/726-root budgets in unchanged Gateway/plugin shards; all 29 compiler graphs passed, and the targeted graphs passed independently. Main integration changed only the generated config fingerprint conflict; the runtime patch remained unchanged. The queued Testbox lease was canceled; no remote workload or local Docker ran. Temporary Gateways use isolated state and foreground processes, with no LaunchAgent or Keychain changes. Local clusters and task-owned large artifacts are cleaned up after validation; installed Homebrew formulas and external-volume worktrees are retained.
What Problem This Solves
Fixes the published-stable SQLite → current → PostgreSQL adoption path, which could duplicate aliased stores, silently omit the port source, reject a valid lazy journal column, or leave local credentials bound to the old database. Qualifies PostgreSQL 16–18 with recorded full conformance runs.
User Impact
Existing 2026.10.5 users can update through their installed updater, port their populated stores to PostgreSQL, and start the Gateway with their agents, sessions, memory, and local credentials intact. The docs state the tested scope: foreground macOS acceptance, no live inference without provider keys, and service activation covered separately by the signed-Mac/Parallels lane. Published 2026.10.5 has no PostgreSQL configuration schema, so a native stable-PG upgrade is not applicable.
Why This Change Was Made
Use physical identity to deduplicate supplemental updater discovery while preserving explicit registry spellings. Take the port's canonical state root from its existing owner. Complete the lazy deletion-journal column only in the private migration copy. Capture credential receipt metadata with the existing port artifacts and rebind it through the credential owner after durable port completion, preserving the local credential rows and provenance. No new schema, migration protocol, or readiness bypass. The simplification pass retained the existing owners and removed duplicate alias discovery. Delta: +249/−29 production lines, +326/−17 test lines, +128/−50 documentation lines.
PostgreSQL 18 rejects malformed JSON before its CHECK constraint in one catalog probe; accept either rejection while retaining strict row-rejection assertions. No CI matrix was added. A weekly sequential PG16/PG18 conformance job is recommended to catch future major-version differences without adding per-PR cost.
Evidence
Final-head CI run 39366445588: all three PostgreSQL conformance shards and
openclaw/ci-gatepassed on50e01a442f95b9c75baca485e4b352d7b2427079.PGQUAL-MAJORS-UPGRADE, local Homebrew PostgreSQL 16.15_1 / 17.11_1 / 18.6_1, unaccent 1.1, pg_trgm 1.6, pgvector 0.8.7. Full unsharded CI entry point on 16 and 18. Counts, source heads, bottle/source SHA256s, lock sizing, and the retained initial failures are in the qualification record.PG16 full: 948 passed / 2 failed / 37 skipped; the three affected files passed once on PG16 and PG17 (10 tests each). PG18 full: 947 passed / 3 failed / 37 skipped; failed files passed on PG17 (9 tests) and PG18 with port/recovery (43 tests). Further PG18 journal regression: 25/25. Initial timeout/cleanup failures are not represented as clean full runs.
Published stable installed-updater run
d3b04126-11d3-4f28-9dd0-146f9fe914b5: exited 0 and activated the exact packed buildb1d415c2448f. PostgreSQL portaae1aaff-ec7e-4dac-afe6-7b46f8589867: two populated stores, retained SQLite captures, foreground Gateway readiness, agent/session/memory continuity, Doctor/status. Unreachable-DSN Doctor returned exit 2 andok: false. Matching pre-upgrade backup + exact stable package rollback passed the same continuity checks. Cell table.Regressions reproduced before their fixes. Final PG17 credential/port/recovery/restore run: 46/46. Final PG18 credential/port/recovery run on integrated head
50e01a442f95: 40/40, including all five credential cases. Core and scripts typechecks, targeted infrastructure/updater test typechecks, lint/format, docs checks, and independent P0–P2 review recorded locally. Full test-graph selection encountered pre-existing 725/726-root budgets in unchanged Gateway/plugin shards; all 29 compiler graphs passed, and the targeted graphs passed independently.Main integration changed only the generated config fingerprint conflict; the runtime patch remained unchanged.
The queued Testbox lease was canceled; no remote workload or local Docker ran. Temporary Gateways use isolated state and foreground processes, with no LaunchAgent or Keychain changes. Local clusters and task-owned large artifacts are cleaned up after validation; installed Homebrew formulas and external-volume worktrees are retained.