Skip to content

fix(memory): register built-in memory embedding providers before manager init (#72875)#72937

Closed
ViagraFixesMyBug wants to merge 3 commits into
openclaw:mainfrom
ViagraFixesMyBug:fix/72875-memory-local-provider-unknown
Closed

fix(memory): register built-in memory embedding providers before manager init (#72875)#72937
ViagraFixesMyBug wants to merge 3 commits into
openclaw:mainfrom
ViagraFixesMyBug:fix/72875-memory-local-provider-unknown

Conversation

@ViagraFixesMyBug

Copy link
Copy Markdown

Fixes #72875

Summary

  • Problem: The memory runtime path throws an Unknown memory embedding provider: local error, breaking memory sync and status checks.
  • Why it matters: Completely blocks the normal usage of local memory features.
  • What changed: Added explicit lazy registration logic (calling registerBuiltInMemoryEmbeddingProviders) before MemoryIndexManager initializes the provider, aligning it with the capability CLI path.
  • What did NOT change (scope boundary): Capability CLI path and other unrelated modules remain untouched.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

Root Cause (if applicable)

  • Root cause: MemoryIndexManager called createEmbeddingProvider without ensuring built-in providers were registered in the registry, unlike the CLI path.
  • Missing detection / guardrail: Lack of pre-check for registry state and auto-registration mechanism.
  • Contributing context (if known): N/A

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Existing coverage already sufficient
    • Unit test
    • Seam / integration test
    • End-to-end test
  • Target test or file: N/A
  • Scenario the test should lock in: N/A
  • Why this is the smallest reliable guardrail: N/A
  • Existing test that already covers this (if any): N/A
  • If no new test is added, why not: This was a missing initialization step in the runtime bootstrap sequence. Static analysis (pnpm check:changed typecheck/lint) confirms type safety and existing unit tests cover the provider registration mechanisms.

User-visible / Behavior Changes

None. (The memory feature simply works as originally intended instead of crashing).

Diagram (if applicable)

N/A

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation: N/A

Repro + Verification

Environment

  • OS: WSL (Ubuntu on Windows)
  • Runtime/container: Node.js / pnpm

Steps

  1. Run memory status check or trigger memory sync in the runtime path.
  2. Observe the error before the fix.

Expected

Memory operations complete successfully without throwing Unknown memory embedding provider: local.

Actual

(Before fix) Throws Unknown memory embedding provider: local.
(After fix) Executes successfully.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: Ran pnpm check:changed locally — all typechecks (core, extensions, tests) passed, linting passed with 0 warnings/errors, no import cycles detected.
  • Edge cases checked: N/A
  • What you did not verify: Manual end-to-end UI testing (relying on CI and local static checks).

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

None.

@greptile-apps

greptile-apps Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Fixes the Unknown memory embedding provider: local error in the runtime path by calling ensureBuiltInMemoryEmbeddingProvidersRegistered() inside MemoryIndexManager.loadProviderResult before createEmbeddingProvider is invoked, mirroring the registration step already present in the CLI path.

Confidence Score: 4/5

Safe to merge — fix is correct and well-scoped; only P2 style finding present.

The root-cause analysis is accurate, the registration call is placed at the right chokepoint (loadProviderResult), and idempotency is guaranteed by filterUnregisteredMemoryEmbeddingProviderAdapters. The only finding is a P2 code-duplication suggestion.

No files require special attention.

Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/memory-core/src/memory/provider-adapters.ts
Line: 139-146

Comment:
**Duplicated logic — delegate to existing function**

`ensureBuiltInMemoryEmbeddingProvidersRegistered` is identical to the body of `registerBuiltInMemoryEmbeddingProviders` that already lives in the same file. Now that `registerMemoryEmbeddingProvider` is imported directly, the new function can simply delegate, eliminating the duplication and keeping the guarding comment in one place.

```suggestion
export function ensureBuiltInMemoryEmbeddingProvidersRegistered(): void {
  registerBuiltInMemoryEmbeddingProviders({ registerMemoryEmbeddingProvider });
}
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(memory): register built-in memory em..." | Re-trigger Greptile

Comment thread extensions/memory-core/src/memory/provider-adapters.ts
@clawsweeper

clawsweeper Bot commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

Close because current main already resolves the local memory embedding provider through the manifest-backed capability provider path, and that implementation shipped in v2026.5.7; the remaining PR branch is redundant and carries a stale SDK bridge edit.

So I’m closing this as already implemented rather than keeping a duplicate issue open.

Review details

Best possible solution:

Keep the shipped manifest-backed provider contract and close this stale branch instead of rebasing manager-side registration into the current SDK layout.

Do we have a high-confidence way to reproduce the issue?

No for current main: the historical failure has strong report and fix evidence, but current source resolves local through the manifest-backed cold lookup path and includes regression coverage for that fallback.

Is this the best way to solve the issue?

Yes for current main: manifest-backed provider ownership is the narrower maintainable fix because it preserves plugin boundaries and covers standalone CLI cold lookup without adding manager-specific eager registration.

Security review:

Security review cleared: The PR only changes in-process memory provider registration and TypeScript exports, with no dependency, workflow, permission, secret-handling, download, or artifact-execution changes.

What I checked:

Likely related people:

  • mattznojassist: Authored the merged manifest contract fix that declares local as a memory embedding provider and closed the earlier same-symptom report. (role: fix contributor; confidence: high; commits: 7036ae548a29, e069d03945ef; files: extensions/memory-core/openclaw.plugin.json, CHANGELOG.md)
  • steipete: Carried the memory-embedding provider plugin refactor and related SDK/runtime routing that the current manifest-backed resolution depends on. (role: feature-history and adjacent area contributor; confidence: high; commits: 77e6e4cf87f7, 6008ed6c2450; files: src/plugins/memory-embedding-provider-runtime.ts, extensions/memory-core/src/memory/provider-adapters.ts, src/plugin-sdk/memory-core-host-engine-embeddings.ts)
  • Nimrod Gutman: Worked on the nearby memory embedding provider registration recursion guard in the same provider-adapter/runtime path. (role: historical registration contributor; confidence: medium; commits: 004704817997; files: extensions/memory-core/src/memory/provider-adapters.ts, src/plugins/memory-embedding-provider-runtime.ts)

Codex review notes: model gpt-5.5, reasoning high; reviewed against ba625e2cff29; fix evidence: release v2026.5.7, commit e069d03945ef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memorySearch provider: "local" fails with "Unknown memory embedding provider: local" but capability embedding path works

1 participant