fix(memory): backfill provider.model with resolved model name#105895
fix(memory): backfill provider.model with resolved model name#105895xydt-tanshanshan wants to merge 1 commit into
Conversation
bb60bd3 to
fc92a83
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 5:06 AM ET / 09:06 UTC. Summary PR surface: Source +3, Tests +19. Total +22 across 2 files. Reproducibility: yes. at source level: an adapter returning an empty model reaches current downstream identity consumers unchanged, and the regression test directly exercises that path. The full persisted restart and vector-search recovery has not been reproduced after the fix. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Keep the single normalization point at provider creation, then demonstrate a one-time rebuild of an affected index followed by restart, clean identity status, and a successful vector query without adding downstream fallback readers. Do we have a high-confidence way to reproduce the issue? Yes at source level: an adapter returning an empty model reaches current downstream identity consumers unchanged, and the regression test directly exercises that path. The full persisted restart and vector-search recovery has not been reproduced after the fix. Is this the best way to solve the issue? Yes, provisionally: enforcing the resolved-model invariant once after provider creation is narrower and more maintainable than adding fallbacks across identity, write, and query consumers. Merge confidence still depends on persisted upgrade-path proof or a maintainer override. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against af469c85cf6c. Label changesLabel justifications:
Evidence reviewedPR surface: Source +3, Tests +19. Total +22 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
Review history (19 earlier review cycles; latest 8 shown)
|
fc92a83 to
a342029
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Persisted upgrade-path proof: identity validation on restartThe review asks for proof that existing dirty indexes recover after upgrade without operator action. Here is the exact identity check from the production code: From const expectedModel = params.provider?.model?.trim() || "fts-only";This is what runs on every gateway restart when validating the persisted memory index identity. If With this PR's backfill, Observed result: With the backfill, the What was not tested: Full gateway restart with a real workspace containing persisted empty-model metadata and vector chunks (requires full workspace setup with configured agent, memory source, and embedding provider). @clawsweeper re-review |
a342029 to
03f60bc
Compare
Persisted upgrade-path proof: identity validation on restartThe review asks for "real proof of dirty-index recovery after upgrade without operator action." Here is a real Real environment: Linux x86_64, Node v24.18.0 (upgraded to satisfy OpenClaw >=24.15.0 requirement), branch Exact command run: pnpm openclaw memory status --deepEvidence after fix: This proves:
Why the index is still dirtyThe persisted Identity check code pathThe identity flow on every restart: Observed result after fix: The What was not tested: Full reindex on this workspace ( @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
03f60bc to
93d3b03
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
93d3b03 to
8d64d9b
Compare
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
8d64d9b to
8673cdd
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Behavior ProofEnvironment: Linux, Node 24.13.1, branch Unit Test — backfill behaviorCode Change (3 lines)The fix at if (result.provider && !result.provider.model) {
result.provider.model = createOptions.model;
}What it proves
API ReachabilityThe qwen3-embedding-8b endpoint at MaaS is reachable and returns valid embeddings (2048-dim), confirming the model identity that gets backfilled is usable for vector search. The full end-to-end proof (affected index rebuild → restart → vector search) requires a running gateway with configured memory, which is not feasible in this CI-free environment. The 3-line source fix is self-contained and regression-tested. |
|
@clawsweeper re-review |
PR #105895 — Memory Embedding Backfill ProofEnvironment: Linux, Node v24.15.0, branch 1. Backfill logic (embeddings.ts:245-247)2. Embedding API test3. Unit tests |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
8673cdd to
99461f9
Compare
When an adapter returns an empty provider.model, set it to the resolved model name from resolveProviderModel. Uses direct property assignment instead of spread to preserve prototype-defined methods on plugin provider objects (P1 finding). Prevents downstream identity mismatches and broken vector search (issue openclaw#90042). Supersedes openclaw#91660 (31 days old, merge conflicts).
99461f9 to
250cfe9
Compare
|
Rebased onto latest main. The remaining proof gap (rebuild affected index → restart → clean status → vector query) requires a running gateway with configured memory embeddings. The project cannot be built in this CI-free environment (build fails on Discord extension dependency). The fix is 3 lines with a targeted regression test (10/10 pass). Would a maintainer accept the test-only evidence given the fix size, or is there a way to validate this on the project's CI infrastructure? |
Summary
When an adapter returns an empty provider.model, backfill it with the resolved model name from resolveProviderModel.
extensions/memory-core/src/memory/embeddings.ts(+3 lines),extensions/memory-core/src/memory/embeddings.test.ts(+19 lines)Change Type
Scope
Linked Issue
Motivation
Memory embedding provider can return an empty provider.model string, causing downstream identity mismatch and broken vector search (#90042).
Real behavior proof
fix/provider-model-backfill-90042-reborn$ node scripts/run-vitest.mjs run extensions/memory-core/src/memory/embeddings.test.tsmodel: ""gets backfilled to"text-embedding-3-small".Root Cause
createWithAdapterin embeddings.ts did not backfill provider.model when the adapter returned an empty value, even thoughresolveProviderModelhad resolved the correct model name.Security Impact
Compatibility / Migration
Best-fix Verdict
AI Assistance
Fixes #90042