Repository navigation
feat(database): admitted search extensions for PostgreSQL stores - #174085
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. |
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: f8a800c72f
ℹ️ 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".
| db.prepare("UPDATE openclaw_schema_meta SET search_extensions = ? WHERE store = ?").run( | ||
| JSON.stringify(next.searchExtensions), | ||
| base.id, |
There was a problem hiding this comment.
Preserve persisted extensions during PostgreSQL migrations
When a PostgreSQL store with a registered extension is opened by a later schema version, databaseEngineAdapters.postgres.schema.migrate verifies both the pre-migration and destination schemas using store.schema, which does not contain the definitions persisted here; withPostgresSearchExtensions is only applied afterward in physical admission. Because the live fingerprint includes the derived extension objects while the scratch DDL omits them, the pre-migration verification reports schema drift and prevents the update. Load search_extensions into both migration schema descriptors before either verification.
AGENTS.md reference: AGENTS.md:L82-L82
Useful? React with 👍 / 👎.
93f5e70 to
49a7700
Compare
|
Codex review: blocked before merge. What this changesAdds owner-registered PostgreSQL search definitions that persist alongside schema metadata and participate in exact catalog validation. Example: A plugin registers keyword search over a notes table using extension name notes-search.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep this PR open: the maintainer-approved capability is useful, but persisted extensions break schema migrations and registration fails on handles that reuse shared admission facts. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe database engine receives schema and search declarations from store owners, installs PostgreSQL derived objects, and returns admitted text and vector capabilities to worker callers. flowchart TD
A[Store owner] --> B[Admitted worker connection]
B --> C[Search extension admission]
C --> D[PostgreSQL derived indexes]
C --> E[Persisted definitions and catalog seal]
E --> F[Store reopen and migration]
F --> B
Technical reviewBest possible solution: Carry persisted search definitions through the existing migration and shared physical-admission owners. Do we have a high-confidence way to reproduce the issue? Source establishes both triggers: migrate a registered version-1 store to version 2, or register an extension through a second anchor handle that inherits physical admission; no target code was executed during this read-only review. Is this the best way to solve the issue? Extending engine-owned search admission is appropriate, but its persisted definitions must follow the same migration and cross-handle lifecycle as the physical admission facts. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7982ee6c0246. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +284, Tests +388, Docs +11, Other +1. Total +684 across 17 files. Added test files: 2. 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 16, 2026, 7:05 AM ET / 11:05 UTC. |
|
Merged via squash.
|
…nclaw#174085) * feat(database): admit persisted search extensions * test(memory): honor optional worker preparation hook * fix(pr): retain search extension admission in wrapper sources
What Problem This Solves
PostgreSQL stores can currently bind only the search definitions supplied by their canonical schema. Plugins cannot safely add derived search indexes and retain exact schema validation across restart.
User Impact
Adds an experimental admitted-store API for owner-registered search extensions. This prepares memory's PostgreSQL integration; memory indexing, retrieval, and Doctor import remain separate follow-ups.
Why This Change Was Made
The engine installs each extension in the owning writer transaction, persists its definition with the existing schema metadata, and includes PostgreSQL's deparsed derived objects in the catalog seal. Reopening compares the persisted fingerprint without scratch DDL. Failed installs and outer transaction rollbacks leave no partial indexes or published admission facts.
Changed definitions, including vector dimensions, raise
SearchExtensionDefinitionChangedErrorwith guidance to restore the prior definition until the owning component can rebuild the derived index. Canonical binary64 embeddings remain authoritative. SQLite registration issues no SQL and retains its existing FTS5/vec0 mechanics.Memory registers text and dimension-specific vector definitions through its existing admitted publication worker; the agent opener re-admits the persisted extensions. No agent schema files change. Builds on #173625.
Evidence
chat-message.test.tsx,config-page-state.ts, andsessions-page-state.ts), plus unused exports in unchangedsrc/gateway/session-utils-row.tsandui/src/pages/chat/components/chat-message-group.test-support.ts. No baseline was changed.materializes full cold/warm PR siblings, then preserves native sparse transitions; 432s elapsed, 120s limit). All previously failing CI cases passed locally; the final-head CI run is 38886232299.Reviewed pre-rebase head:
93f5e707b5b4574f7a6187f44045d67d00727506.Mechanical rebase head:
49a7700bb13e446988e103f47e034cb03e04cb59. The only conflict was the wrapper inventory: retained both main’sregistry.tsand this PR’ssearch-extension.ts. All 17 files retain identical added/removed patch content. The focused PR wrapper inventory test passed after rebase. Current-head CI 38889887303 passed: 62 successful jobs, 24 skipped, zero failures. PostgreSQL conformance, search/engine tests, and all typechecks passed. No CI rerun or fix push was needed.Production delta: 285 net lines, including the one-line wrapper inventory correction; tests +388, docs +11. Agent schema sources and generated artifacts are unchanged.