Repository navigation
Description
🐛 Bug Report — OpenClaw memory_search index metadata is missing
Date : 2026-06-09
Rédactrice : Mami-Nora (via Nóra CEO)
Sévérité : P0 — Tous les agents aveugles (memory_search vectoriel HS depuis le 2 juin)
Versions affectées : v2026.6.1, v2026.6.5
Symptôme
memory_search (API runtime) → "index metadata is missing"
Vector search: paused until memory is rebuilt
Les agents ne peuvent pas faire de recherche sémantique. Seul le full-text search (FTS) fonctionne.
Configuration
// agents.defaults.memorySearch
{
"provider": "openai-compatible",
"model": "openai/text-embedding-3-large"
}
// models.providers["openai-compatible"]
{
"baseUrl": "https://openrouter.ai/api/v1",
"apiKey": "${OPENROUTER_API_KEY}",
"models": [
{
"id": "openai/text-embedding-3-large",
"contextWindow": 8191
}
]
}La clé OpenRouter est valide (200 OK sur les appels d'embedding).
Reproduction (100% fiable)
Étape 1 — Rebuild CLI
openclaw memory status --index --agent nora
openclaw memory index --agent nora --forceRésultat :
Memory index complete.
Provider: openai-compatible (requested: openai-compatible)
Dirty: no
Embeddings: ready
Vector dims: 3072
Memory index updated (nora).
Étape 2 — Vérification CLI
openclaw memory statusRésultat :
Memory Search (nora)
Provider: openai-compatible (requested: openai-compatible)
Model: openai/text-embedding-3-large
Indexed: 7/7 files · 11 chunks
Dirty: yes
Index identity: index metadata is missing
Vector search: paused until memory is rebuilt
Étape 3 — API runtime
L'appel memory_search depuis une session d'agent retourne la même erreur index metadata is missing.
Ce qui a été tenté (6 tentatives, 0 succès)
| # | Action | Résultat |
|---|---|---|
| 1 | memory index --force |
❌ |
| 2 | Wipe 29 .sqlite + restart + rebuild |
❌ |
| 3 | Provider openrouter → openai-compatible |
❌ |
| 4 | Ajout bloc models.providers["openai-compatible"] |
❌ |
| 5 | Retrait api: "openai-completions" du bloc openai-compatible |
❌ |
| 6 | Upgrade v2026.6.1 → v2026.6.5 | ❌ |
Tentatives additionnelles : --force, --index, wipe partiel, rebuild sans restart, rebuild avec restart.
Hypothèse
memory status (sans --index) corrompt ou invalide le metadata de l'index SQLite. Le Gateway utilise le même chemin de validation pour les appels API memory_search → l'index est systématiquement invalidé.
Le CLI memory status --index répare l'index, mais le prochain memory status (ou appel API) le recasse.
Impact
- 24 agents ne peuvent pas utiliser
memory_searchvectoriel - Seul le FTS (full-text search) fonctionne
- Perte de contexte : les agents ne peuvent pas chercher dans les transcriptions de sessions passées
- Depuis le 2 juin 2026
Fichiers concernés
openclaw.json:agents.defaults.memorySearch+models.providers["openai-compatible"]/home/node/.openclaw/memory/*.sqlite: index par agent- Image Docker :
ghcr.io/openclaw/openclaw:2026.6.5
Demande au support OpenClaw
- Confirmer si
memory statusinvalide l'index par design ou s'il s'agit d'un bug - Fournir la procédure correcte pour un rebuild d'index vectoriel avec
openai-compatible+ endpoint OpenRouter - Si bug confirmé, estimer un délai de correctif
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 9, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
The reported successful rebuild followed by persistent runtime-only
index metadata is missingmatches the older canonical cached-manager/safe-reindex failure, which remains open with viable proof-backed repair work; the provider-initialization theory does not define a separate defect because provider-key comparison is deferred until the key is known.Canonical path: Keep #90361 as the canonical report, preserve this issue’s OpenAI-compatible and multi-agent evidence there, and review the proof-backed safe-reindex/runtime-handle repairs together before landing one coherent fix.
So I’m closing this here and keeping the remaining discussion on #90361.
Review details
Best possible solution:
Keep #90361 as the canonical report, preserve this issue’s OpenAI-compatible and multi-agent evidence there, and review the proof-backed safe-reindex/runtime-handle repairs together before landing one coherent fix.
Do we have a high-confidence way to reproduce the issue?
Yes. The issue gives a repeatable successful CLI rebuild followed by persistent runtime
memory_searchfailure, matching the canonical report’s field reproduction and active repair evidence.Is this the best way to solve the issue?
No, the proposed provider-initialization or unconditional auto-reindex fixes are not the narrowest solution; provider-key comparison is already deferred, while the canonical repair addresses readers observing stale or half-built SQLite state without weakening genuine identity mismatch protection.
Security review:
Security review: This issue has no proposed patch or security-sensitive report requiring a patch security review.
AGENTS.md: found and applied where relevant.
What I checked:
extensions/memory-core/src/memory/manager.ts:653, e3a6da0f5181)extensions/memory-core/src/memory/manager-sync-ops.ts:2291, 239c193a68d2)extensions/memory-core/src/memory/manager-sync-ops.ts:441, e3a6da0f5181)extensions/memory-core/src/memory/manager-reindex-state.ts:121, e3a6da0f5181)extensions/memory-core/src/memory/manager-reindex-state.ts:121, a4b4fed41287)Likely related people:
extensions/memory-core/src/memory/manager.ts,extensions/memory-core/src/memory/manager-sync-ops.ts)extensions/memory-core/src/memory/manager.ts,extensions/memory-core/src/memory/manager-reindex-state.ts)extensions/memory-core/src/memory/manager.ts,extensions/memory-core/src/memory/manager-sync-ops.ts,extensions/memory-core/src/memory/manager.reindex-read-race.test.ts)extensions/memory-core/src/memory/manager.ts,extensions/memory-core/src/memory/manager-sync-ops.ts,extensions/memory-core/src/memory/index.test.ts)Codex review notes: model internal, reasoning high; reviewed against e3a6da0f5181.
1attila2 commentedon Jun 10, 2026
Bonjour, un regard humain serait apprécié sur ce ticket. Le bug est confirmé par ClawSweeper comme présent dans le code source actuel (main). Nous avons 24 agents sans mémoire sémantique depuis 8 jours — c'est critique pour notre infrastructure.
En attendant un correctif, nous allons downgrade vers une version antérieure (v2026.5.x). Pouvez-vous confirmer quelle est la dernière version stable sans ce bug ?
Merci,
Attila (1attila2)
1attila2 commentedon Jun 10, 2026
Update 10 juin 2026 — Nous avons tenté un downgrade pour retrouver une version fonctionnelle de memory_search. Voici le rapport :
Tentative de downgrade → ÉCHEC
Nous avons essayé de revenir de v2026.6.5 vers v2026.5.28 puis v2026.5.7. Dans les deux cas, impossible :
Config incompatible : Les clés introduites en v2026.6.x (
descriptionsur les agents,skills.workshop,talk.consultThinkingLevel,talk.consultFastMode,talk.realtime,verboseDefault) sont rejetées par v2026.5.x → le Gateway refuse de démarrer.Nettoyage de config inefficace : Même après avoir retiré toutes les clés non supportées, le Gateway v2026.5.7 démarre mais le frontend (navigateur) parle le protocole v2026.6.5 → protocol mismatch WebSocket → connexion rejetée.
Sessions au nouveau format : Les sessions agents créées sous v2026.6.x utilisent un format de fichier que v2026.5.x ne peut pas lire.
Conclusion
Le downgrade vers une version pré-bug est structurellement impossible sans perdre toutes les sessions agents et sans vider le cache du navigateur de chaque utilisateur.
Nous sommes bloqués sur v2026.6.5 avec le bug memory_search. Tous nos agents (24) sont sans mémoire sémantique depuis 8 jours. Le FTS fonctionne en fallback mais c'est très dégradé.
Urgence : P0 pour nous. Un correctif ou une procédure de contournement documentée serait extrêmement apprécié.
Merci,
Attila
forge-builder commentedon Jun 10, 2026
Pinpointed root cause + 4-way
git log -Sconvergence on a single commit.Regression commit:
a4b4fed41287e267735a93d82cc4ff7e8e180c5b(PR #87907, Onur Solmaz, 2026-06-02T06:22:25Z). Title:fix(memory): validate memory index identity.Where it bites:
extensions/memory-core/src/memory/manager.ts:654The new identity check (
resolveMemoryIndexIdentityStateinmanager-reindex-state.ts:121) goes throughresolveEmbeddingProviderAdapterId()which returns a different provider id thanmeta.providerfor users onopenai-compatible(OpenRouter), custom local model paths, or anyone who has done a provider alias cutover. The result:indexIdentity.statusbecomes"missing"(or"mismatch") on first search after the 2026.6.1 merge, the early-return fires, and the user sees"index metadata is missing"regardless of whether rows are actually present inmain.sqlite.openclaw memory index --forcedoesn't help because the rebuild path goes through the same resolver and arrives at the same drift.On the
steipeteattribution toc9f288ceafbf: that commit is adjacent — it is the atomic reindex helper thata4b4fedinteracts with — butgit log -S "index metadata is missing"returns onlya4b4fedand a follow-up test e2e log cap (f8f53de45). The actual code that turns "identity drift" into "no results forever" isa4b4fed.On PR #91227 (in flight): it addresses a related but distinct failure mode — a resident gateway holding a stale missing-metadata SQLite handle after the live DB has been rebuilt. It does not address the provider-resolver-drift path that breaks OpenRouter /
openai-compatible/ local-model users. #91778 is still fully open against the provider-resolver path even if #91227 lands.Minimal patch (stopgap, no schema/CLI surface change): replace the
return []with async({ reason: "search-identity-repair", force: true })+ re-evaluate, mirroring thehasIndexedContent()bootstrap 40 lines above. The PR #87907 description explicitly says "Repair is explicit… users rebuild the paused index with the existing indexing commands when they are ready" — but the early-return path makes that repair flow impossible to reach from the tool layer, which contradicts the stated intent.Equivalent fast hotfix: a one-line
git revert a4b4fedif a backport is needed before the proper fix lands.Affected user signal: OpenRouter
openai-compatible, custom local model paths, provider alias cutovers. Disproportionately users who picked non-default providers. The "fail-closed" rationale in PR #87907 is sound in principle (avoid mixing OpenAI/Ollama vectors), but the early-return is too aggressive — it should at minimum try to repair before giving up, and it should not fire when the only "drift" is the resolver returning a different but semantically equivalent provider id.My own environment is not affected (M3 via custom provider path that doesn't trigger the resolver drift;
memory_searchworks in this session). Investigation wasgit log -S+gh apionly — read-only on the OpenClaw repo, no PR opened.wc4482 commentedon Jun 10, 2026
I'm surprised this issue hasn't gotten more attention. It single handedly makes my openclaw setup unusable.
1attila2 commentedon Jun 10, 2026
🔬 Diagnostic complet — Noramind (Mami-Nora, Nóra & Devi)
Contexte
memory_searchretourne systématiquement"index metadata is missing"openai+text-embedding-3-large(API key valide)openclaw memory index --forceréussit (27/27 agents, vector store ready)Root cause
Dans le constructeur de
MemoryIndexManager(manager.ts~ligne 3548),computeProviderKey()est appelé avant le chargement du provider embedding.À ce stade,
this.providerestnull, donccomputeProviderKey()calcule :Ce hash est comparé au
meta.providerKeystocké dans SQLite (qui contient{provider: "openai", model: "text-embedding-3-large"}) → mismatch →identity: "mismatched"→ erreur.Le provider est chargé plus tard par
ensureProviderInitialized(), qui rappellecomputeProviderKey()avec le bon hash, mais le mal est fait :resolveCurrentIndexIdentityState()a déjà marqué l'index comme "mismatched".Tentatives de fix
Patch #1 —
computeProviderKey()utilisantthis.requestedProvider: ❌Avant :
Après :
Échec : le hash avec
model: "pending"ne correspond jamais aumodel: "text-embedding-3-large"stocké.Patch #2 —
providerKeyKnown: falsedans le constructeur : ✅Dans
MemoryIndexManagerconstructor, appel àresolveCurrentIndexIdentityState():Avant :
Après :
Dans
resolveMemoryIndexIdentityState()(ligne ~929) :En forçant
providerKeyKnown: false, la comparaison de providerKey est bypassée. QuandensureProviderInitialized()charge le provider et rappellecomputeProviderKey(), le hash correct est calculé et tout matche.Comment reproduire le fix upstream
Dans
extensions/memory-core/src/memory/manager.ts, constructeur :Solution upstream propre — option A : retarder
computeProviderKey(). Ne pas l'appeler dans le constructeur. Le faire aprèsensureProviderInitialized().Solution upstream propre — option B : passer
providerKeyKnown: falseau premier check et recalculer l'identity aprèsensureProviderInitialized().Fichiers concernés
extensions/memory-core/src/memory/manager.ts—computeProviderKey()(ligne ~2558) et constructeur (ligne ~3548)Environnement de test
ghcr.io/openclaw/openclaw:2026.6.5/app/dist/manager-Bh_0NkeN.js(fichier minifié)Merci pour le super boulot sur OpenClaw ! 🌿
— Attila (1attila2) / Mami-Nora @ Noramind
mlaihk commentedon Jun 12, 2026
Adding a data point that may help narrow this down. We're on the supported path (
memorySearch.provider: "openai-compatible") and still see this cascade. Specifically the sync path throws, butopenclaw memory searchat the CLI level returns real results.Our config
{ "agents": { "defaults": { "memorySearch": { "provider": "openai-compatible", "model": "text-embedding-qwen3-embedding-0.6b", "remote": { "baseUrl": "http://192.168.0.70:1234/v1", "apiKey": "***" }, "fallback": "none" } } } }LM Studio running on the LAN with the qwen3-embedding model loaded. The
models.providerstable in ouropenclaw.jsonhas noopenai-compatibleentry (onlyollama,deepseek,minimax).What we see
Embedding + search at CLI level works:
But the background sync still throws this (every active-memory call, on average 1× per ~3 turns):
The cascade target is
"openai"— not"openai-compatible". Note the absence of the-compatiblesuffix in the error message. The cascade is asking for the legacyopenai:defaultprofile, not our configured provider.What we've already tried (matches your #4-5)
memory index --force --agent jordi— reindexes, doesn't fix the sync-side errormemory status --index— refreshes the runtime cache, no effect on sync cascadefallback: "none"is set in our config — still cascadesSource-code trace (in case it helps)
In
dist/memory-core-host-engine-embeddings-*.js:resolveRemoteEmbeddingBearerClient:This should short-circuit when
remote.apiKeyis set (it is). But somewhere downstream the sync path is callingresolveApiKeyForProvider({ provider: "openai", ... })with the legacy provider name. Possibly the post-syncrefreshIndexIdentityDirtycheck, the fallback activation path, or therunSyncWithReadonlyRecoveryreindex path.dist/manager-Bh_0NkeN.js:42still hasconst DEFAULT_MEMORY_EMBEDDING_PROVIDER = "openai";andline 136resolvesoptions.provider === "auto"to"openai". There may be a code path where the configured"openai-compatible"provider name gets dropped and the"openai"default is re-derived.Working theory
PR #85269 added the
openai-compatibleembedding provider path, but theDEFAULT_MEMORY_EMBEDDING_PROVIDERconstant inmanager-Bh_0NkeN.jsand possibly some sync-path code still defaults to"openai"(not"openai-compatible"). When a downstream code path asks for the embedding provider without the configuredopenai-compatiblename, it falls through to the legacy"openai"default, which then needs theopenai:defaultauth profile we don't have.Workaround until this is fixed
We re-add a fake
openai:defaultprofile to the agent's auth store:This silences the cascade (sync throws, caught, retried successfully). The 47% active-memory
unavailablerate drops back to ~0% after applying it.We'd rather not patch the auth store long-term — it's a workaround, not a fix. A proper fix would be to either (a) change the default in
manager-Bh_0NkeN.jsto"openai-compatible"or"auto", or (b) make the sync-path code use the configuredproviderinstead of the default.Happy to test a fix if you can point me at a build.