Repository navigation
refactor(embeddings): share configured local-service contract - #188357
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: blocked before merge. What this changesThis PR gives embedding providers and Memory Core one shared type for acquiring configured local services. Example: An SDK plugin creates embeddings through an Ollama service at http://127.0.0.1:11434.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: it is a useful, maintainer-directed consolidation, and no introduced correctness or security defect was found. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherMemory Core passes a host-injected acquisition hook to embedding adapters; the host leases the configured service, adapters perform requests, and leases are released after settlement. flowchart LR
A[Memory tools and CLI] --> B[Memory Core]
B --> C[Embedding adapter]
C --> D[Configured service host]
D --> E[Managed local process]
C --> F[Embedding HTTP request]
F --> B
Technical reviewBest possible solution: Use the existing configured-service contract throughout the complete caller chain while retaining host lifecycle ownership. Do we have a high-confidence way to reproduce the issue? This PR addresses source duplication rather than a reported runtime bug; inspection confirms the copied declarations and assertions on main. Is this the best way to solve the issue? The smallest complete refactor promotes the existing hook into creation options and replaces private copies across all affected callers, without introducing another lifecycle owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 03ba6b472028. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -47, Tests -4, Docs +11, Other -1. Total -41 across 23 files. Added test files: 0. View PR surface stats
Review metrics
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 30, 2026, 9:37 AM ET / 13:37 UTC. |
|
Merged via squash.
|
…aw#188357) * refactor(embeddings): share configured local-service contract * docs(embeddings): scope service hook guidance to bundled providers * fix(plugins): preserve explicit undefined local service reconciler * test(plugins): guard strict local service reconciler typing
Related: #188252
What Problem This Solves
Embedding providers and Memory Core duplicate the host’s configured local-service acquisition contract.
User Impact
Embedding behavior stays unchanged. Strict runtime callers retain explicit undefined reconciler support; process configuration remains host-owned.
Why This Change Was Made
Reuse the existing acquisition contract across bundled consumers and remove copied shapes and assertions. Preserve hook identity, lazy forwarding, readiness, cancellation and lease settlement. The bundled-only type export remains private.
Evidence
Scoped formatting, syntax, whitespace and commit checks passed. Fresh independent full-range review found no actionable findings. The strict consumer regression checks undefined acceptance, invalid reconciler rejection and forbidden process configuration.
The actual strict public SDK consumer passed in a qualified private native PR workspace: one test, 1.15 seconds. The final native declaration/API comparison of bffe87c..5b1a95f completed successfully: all 171 tracked exports remain reachable, with no entrypoint or export removals. Emitted declarations retain explicit undefined reconciliation; process configuration remains excluded from the acquisition target. This is compiler/declaration proof, not a substitute for runtime tests. Affected tests, type/lint and exact-head CI passed for this replacement head; see the run below.
The original-head CI had a separate PostgreSQL archive/config-alias conflict in unchanged backup/config files. Its failure remains investigated evidence, not a passing result or a claimed fix by this type repair.
Native landing evidence: required CI run 41072058147 passed for reviewed head 5b1a95f. Root inspected the full source cutover and fresh independent full-range review with no actionable findings. Personal dependency-backed execution remains unrun; exact-head CI supplies executable tests, types and lint proof. Observable production behavior and shipped contracts remain unchanged.