Repository navigation
refactor(memory): simplify LanceDB embedding lifecycle - #125841
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 10:05 AM ET / 14:05 UTC. ClawSweeper reviewWhat this changesThis PR makes each cached LanceDB embedding-provider entry own its own retirement wait, consolidates config/auth/replacement shutdown through that path, and removes duplicated lifecycle choreography from plugin end-to-end tests. Merge readinessKeep open. This is a fresh, maintainer-owned lifecycle refactor; current main still has the pre-refactor service-wide admission logic, and no blocking correctness defect was found. Likely related people: steipete (recent owner) and yt2102 (historical lifecycle contributor). Priority: P3 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe LanceDB memory plugin obtains an embedding provider per agent to vectorize stored and recalled memories. When config or auth changes, the provider lifecycle waits for admitted work, closes the old client, and allows the replacement to serve later requests. flowchart LR
A[Memory request] --> B[Per-agent provider entry]
B --> C[Embedding request]
D[Config or auth change] --> E[Retire cached entry]
C --> F[Entry becomes idle]
E --> F
F --> G[Close old provider]
G --> H[Create replacement provider]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -46, Tests -95. Total -141 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep retirement ownership per provider entry and merge only after exact-head lifecycle validation confirms replacement waits for admitted work and retries failed closes. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a behavior-preserving refactor, and the relevant invariant is exercised by focused lifecycle coverage rather than a new user report. Is this the best way to solve the issue? Yes. Entry-scoped retirement matches the provider-map ownership boundary and preserves the existing rotation and close-retry contract without adding configuration or a parallel lifecycle. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6a97ba4f8b6f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready evidence for exact head
No known proof gap or unresolved review finding remains. |
|
Merged via squash.
|
Related: #125567
What Problem This Solves
Simplifies the lifecycle repair introduced in #125567. The shipped behavior is correct, but provider retirement tracked admitted work both at the service and per-provider-entry levels, and its regression coverage repeated provider fixtures and replacement choreography across suites.
Why This Change Was Made
Provider-entry admission is now the single lifecycle authority. Configuration changes, auth-profile mutation, runtime replacement, and service shutdown all retire entries through one path; each entry has one idle resolver because removal from the provider map gives it one retirement owner. Tests use shared provider/deferred fixtures and leave replacement ordering to the lifecycle suite instead of repeating it in plugin e2e coverage.
User Impact
No user-visible behavior changes. Memory bounds, live embedding credential/endpoint rotation, startup-stable vector identity, per-agent isolation, timeout behavior, and close retry semantics remain unchanged with less lifecycle and test code to maintain.
Evidence
node scripts/run-vitest.mjs extensions/memory-lancedb/index.test.ts extensions/memory-lancedb/embeddings.lifecycle.test.ts extensions/memory-lancedb/memory-cli.test.ts extensions/memory-lancedb/lancedb-store.test.ts— 163 tests passed.pnpm test:extension memory-lancedb— 187 tests passed.node scripts/check-changed.mjs -- extensions/memory-lancedb/embeddings.ts extensions/memory-lancedb/embeddings.lifecycle.test.ts extensions/memory-lancedb/index.test.ts— passed.git diff --check— passed.