Repository navigation
fix(infra): keep PostgreSQL owner acquisition used by production - #198270
Conversation
Move the unchanged custody adapter to its own module so the configured PostgreSQL acquisition API has a real production consumer. Preserve its existing failure-boundary tests and avoid deadcode allowlist changes. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR moves the existing PostgreSQL custody adapter into a separate module so owner acquisition has an external production consumer. Example: The production export scan examines acquireConfiguredGatewayPostgresOwner.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR makes a coherent, behavior-preserving repair to the production import graph; no introduced correctness defect was found, but head CI remains unresolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway lock acquisition composes local process custody with optional PostgreSQL session ownership, forwarding session loss into the existing owner signal and releasing the session when physical custody ends. flowchart LR
A[Gateway and offline CLI] --> B[Gateway lock]
B --> C[PostgreSQL custody adapter]
C --> D[Configured owner acquisition]
D --> E[PostgreSQL advisory lock]
C --> F[Process owner loss signal]
Technical reviewBest possible solution: Retain the unchanged custody adapter at its new module boundary and complete attribution of the failed head check before landing. Do we have a high-confidence way to reproduce the issue? Source confirms that main's acquisition export has only an in-module production caller and external test consumers; GitHub annotations confirm the reported dead-code gates failed, but no local scan was run. Is this the best way to solve the issue? The relocation is a focused solution: it gives the existing acquisition owner a real production importer while preserving its failure-boundary tests, lifecycle semantics, and strict export policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 439a9c3552da. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +4. Total +4 across 3 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: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 November 13, 2026, 8:20 AM ET / 13:20 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…law#198270) Move the unchanged custody adapter to its own module so the configured PostgreSQL acquisition API has a real production consumer. Preserve its existing failure-boundary tests and avoid deadcode allowlist changes. Co-authored-by: obviyus <[email protected]> Co-authored-by: steipete <[email protected]>
What Problem This Solves
check-dependenciesfails on main (run https://github.com/openclaw/openclaw/actions/runs/43425732822, job 131887281463): the production dead-export scan reportsacquireConfiguredGatewayPostgresOwnerinsrc/infra/gateway-postgres-owner.ts, added by #196237. Production only calls it from inside the same module (viacreateGatewayPostgresCustody); its only external importers are two PostgreSQL test suites, so it can't simply become private.User Impact
None at runtime; module boundary only.
Why This Change Was Made
The unchanged 30-line custody adapter moves to its own module,
src/infra/gateway-postgres-custody.ts, which imports the acquisition helper normally;gateway-lock.tsimports the adapter from the new module. The helper now has a real production importer and keeps its test consumers. No allowlist or baseline change.Evidence
Worked on by
Work sessions
Linked for team reference; these sessions aren’t public.