fix(memory): resolve adapter default model in plain status identity check#90748
fix(memory): resolve adapter default model in plain status identity check#90748849261680 wants to merge 1 commit into
Conversation
|
Codex review: passed. Reviewed June 5, 2026, 10:16 PM ET / 02:16 UTC. Summary PR surface: Source +9, Tests +33. Total +42 across 2 files. Reproducibility: yes. Source inspection shows current main's plain status path refreshes index identity before provider initialization and compares index metadata against Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Next step before merge
Security Review detailsBest possible solution: Land this focused fix after exact-head CI and mergeability gates pass; the linked bug can then close through the merged PR. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main's plain status path refreshes index identity before provider initialization and compares index metadata against Is this the best way to solve the issue? Yes. The PR fixes the shared identity resolver to mirror the existing provider initialization model fallback, instead of adding a CLI-only workaround or forcing a deep provider probe on the fast status path. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3a2f54e6a866. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +9, Tests +33. Total +42 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Added live before/after CLI proof to the PR description (real
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper automerge |
|
🦞🔧 Source: I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow CI fix. Automerge progress:
|
|
ClawSweeper 🐠 reef update Thanks for the work here. GitHub would not let ClawSweeper push to this branch with the available credentials, so the fix moved to a narrow replacement PR. nothing personal, just permission currents. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: model gpt-5.5, reasoning high; reviewed against 9741437. |
Summary
openclaw memory statusalways printedIndex identity: index was built for model <X>, expected(blank expected) andVector search: paused until memory is rebuilt, even right after a successfulopenclaw memory index --force. As a resultmemory_searchtool calls returneddisabled: true, error: "index metadata is missing".openclaw memory status --deepreported the system healthy — only the plain status path was broken.Fixes #90413.
Root cause
MemoryManagerSyncOps.resolveCurrentIndexIdentityStatebuilt the configured provider identity fromthis.settings.modeldirectly. For an agent with the defaultmemorySearch.model(the empty string""), the plainmemory statuspath runs before the provider is initialized, sosettings.modelis still that unresolved empty default. The empty string survives the existing??/direct assignment, so identity comparedmeta.model(e.g.text-embedding-3-small) against"", declared a mismatch, and printed a blank "expected" model. The--deep/ index paths initialize the provider first, where the adapter default model is resolved, so they were unaffected.Fix
Resolve the configured model the same way provider initialization does — use the trimmed configured model when set, otherwise fall back to the adapter's default via the existing
resolveEmbeddingProviderFallbackModelhelper. This keeps the plain status identity check symmetric with the initialized path. TherefreshIndexIdentityDirtyuninitialized branch delegates to this same function, so it is fixed in one place; the initialized branch already carries the resolvedprovider.model.Automated tests (supplemental)
node scripts/run-vitest.mjs extensions/memory-core/src/memory/index.test.ts— new regression test passes; all identity tests pass (5 passed).oxfmt --checkclean on both changed files.Real behavior proof
Real
openclawCLI built from this source tree (OpenClaw 2026.6.2), isolatedOPENCLAW_HOME, agentmainwithmemorySearch.provider: "openai"and no explicit model (the empty-string default that triggers the bug), pointed at a local OpenAI-compatible/v1/embeddingsendpoint so indexing runs fully offline. The exact same on-disk index is reused for both captures — only the patched binary differs, no reindex between them.Behavior addressed: plain
openclaw memory statusfalsely reporting anIndex identitymismatch with a blank "expected" model andVector search: pausedwhenmemorySearch.modelis the empty default, which in turn reportsmemory_searchas disabled.Real environment tested: real
openclawCLI built from this source tree, run against a live local/v1/embeddingsendpoint with an isolatedOPENCLAW_HOME; the index was built once withopenclaw memory index --agent main --force(Memory index updated (main).).Exact steps or command run after this patch:
OPENCLAW_HOME=… openclaw memory status --agent main(identical index on disk; the only difference between the two captures below is the patched binary).Evidence after fix: Before the patch, plain
openclaw memory status --agent mainprinted the false identity mismatch and pause:After the patch, the same on-disk index (no reindex) reports healthy — the
Index identityandVector search: pausedlines are gone andDirtyflips tono:Observed result after fix: plain
memory statusreports the existing index as valid, somemory_searchis no longer reported asdisabled/index metadata is missing.openclaw memory search "fallback embedding provider" --agent mainreturns the indexed chunk (0.627 memory/notes.md:1-5) in both builds, matching the report that CLI search keeps working while plain status falsely pauses.What was not tested: a Homebrew-packaged install (verified against a source build instead) and a hosted embedding endpoint (a local OpenAI-compatible
/v1/embeddingsendpoint stood in fortext-embedding-3-small, which only affects the stored vectors, not the identity-resolution path under test).