Repository navigation
fix #95495: [Bug]: 2026.6.9 silently relocates memory store with no migration, forcing a full re-embed (1499 files) with zero upgrade-time warning - #95631
Conversation
|
Codex review: found issues before merge. Reviewed June 24, 2026, 4:29 AM ET / 08:29 UTC. Summary Reproducibility: yes. Current main opens the per-agent memory database while the existing migration only handles legacy tables inside that opened database, and the canonical issue contains field evidence of the separate populated sidecar being ignored. Review metrics: 4 noteworthy metrics.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the doctor-owned memory migration, rebase onto current main, remove unrelated MCP/runtime and dependency/version drift, then rerun exact-head migration and changed-check proof before merge. Do we have a high-confidence way to reproduce the issue? Yes. Current main opens the per-agent memory database while the existing migration only handles legacy tables inside that opened database, and the canonical issue contains field evidence of the separate populated sidecar being ignored. Is this the best way to solve the issue? Yes for the intended memory boundary, no for the current PR shape: a doctor-owned one-shot import is the right fix, but the branch must drop unrelated runtime/dependency drift and refresh before merge. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 63ee4cd2405c. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
Acceptance criteria:
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
|
aba0e53 to
5781ae3
Compare
5781ae3 to
11fd5b1
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
e0d6bbb to
8b32dbd
Compare
8b32dbd to
c243466
Compare
|
Merged via squash.
|
Summary
$OPENCLAW_STATE_DIR/memory/<agent>.sqliteinto the canonical per-agent SQLite database through an explicit doctor state migration.chunks_vecsemantic vector rows intomemory_index_chunks_vecbefore successfully handled sidecars are archived.Origin / follow-up
N/A — this updates the existing issue fix PR, not a sibling follow-up to a merged change.
Root Cause
$OPENCLAW_STATE_DIR/memory/<agent>.sqliteto$OPENCLAW_STATE_DIR/agents/<agent>/agent/openclaw-agent.sqlite, but the upgrade path initialized the new per-agent schema without importing the old sidecar index rows.ensureMemoryIndexSchema()stays responsible for canonical schema creation for the database it is given; doctor migration handles the one-time sidecar-to-agent import and archive.What Changed
meta,files,chunks,embedding_cache, and matching legacy vector rows into the canonical memory index tables.memory-core-legacy-sidecar-index-to-agent-sqliteinextensions/memory-core/doctor-contract-api.ts.chunks_vecrows exist.chunks_vecrows intomemory_index_chunks_vecbefore archive.openclaw/plugin-sdk/memory-core-host-engine-storage.canonical-not-emptyskip so unrelated canonical rows do not block safe legacy sidecar import.Review findings addressed
pnpm dev doctor --fix --non-interactive, followed bypnpm dev memory status --agent main --jsonandpnpm dev memory search ... --jsonagainst a migrated legacy sidecar in a temporaryOPENCLAW_STATE_DIR.openclaw updaterun and third-party live embedding-provider proof were not run; those proof boundaries are disclosed below.canonical-not-emptyskip with row-level copy verification. Non-conflicting legacy rows now merge into existing canonical indexes; real row conflicts warn and leave the sidecar at its original path.chunks_vecrows into canonicalmemory_index_chunks_vecbefore archive, and by keeping sidecars in place when vector dimensions conflict.openclaw update, and live external provider proof were not run.chunks_vecrows during explicit sidecar import.Regression Test Plan
packages/memory-host-sdk/src/host/memory-schema.test.ts,extensions/memory-core/doctor-contract-api.test.ts, andtest/scripts/plugin-sdk-surface-report.test.ts.node:sqlitedatabases, sqlite-vec loading, and the actual schema/migration/search code paths, so they cover the missing-import upgrade path, stale-sidecar startup boundary, row-conflict retry safety, vector-dimension guard, and vector-row archive risk without mocking the storage layer.Real behavior proof
Behavior or issue addressed: Upgrading from the legacy memory sidecar store can preserve existing memory index rows through an explicit doctor state migration, while normal schema startup does not import stale sidecar state. Doctor now merges non-conflicting legacy rows into existing canonical indexes and keeps the sidecar in place when row conflicts or vector-dimension mismatches make import unsafe.
Real environment tested: Local OpenClaw PR worktree using real
pnpm devCLI commands, a temporaryOPENCLAW_STATE_DIR, a temporary workspace, realnode:sqlitedatabases, Memory Core doctor state migrations, and FTS-only memory search withagents.defaults.memorySearch.provider none.Exact steps or command run after this patch:
Fresh post-commit validation for the retry-safety and SDK-surface follow-up:
[ { "agentId": "main", "status": { "backend": "builtin", "files": 1, "chunks": 1, "dirty": false, "provider": "none", "requestedProvider": "none", "sourceCounts": [ { "source": "memory", "files": 1, "chunks": 1 } ], "fts": { "enabled": true, "available": true }, "vector": { "enabled": false }, "custom": { "indexIdentity": { "status": "valid" } } }, "scan": { "totalFiles": 1, "issues": [] } } ]{ "results": [ { "id": "51a9a894d0d4feead08549f1b5989365450634f69b7d17dcc7223c43f434cb41", "path": "memory/MEMORY.md", "startLine": 1, "endLine": 2, "score": 0.7633373333173334, "textScore": 0.000003999984000064, "snippet": "remember this legacy doctor migration needle\n", "source": "memory" } ] }Observed result after fix: The doctor migration imports legacy sidecar rows into the per-agent SQLite database, makes
memory statusreport 1 file / 1 chunk withdirty: falseandindexIdentity.status: valid, and makesmemory searchreturn the migrated legacy memory content through the real CLI. Fresh post-commit tests also show that unrelated canonical rows merge with sidecar rows, row conflicts preserve the sidecar with a warning, and vector-dimension mismatches preserve the sidecar instead of archiving unsafe state.What was not tested: Not run: packaged release-beta upgrade install, redacted real
openclaw update, the reporter's original 1499-file state directory, or third-party live embedding-provider proof. The CLI proof used FTS-only local memory search (provider: none) to validate the migrated index through real OpenClaw CLI commands. A live OpenAI deep provider probe was attempted separately in this environment and returned an unsupported country/region 403, so that external provider proof remains unavailable here.Round-two CI attribution
5b930286e9b27b89f4a4844ffe937d303fd16af4.fa05f5eaec2d5bd04c0e6b520cf6367863321455.b097896e97b2f5bc98b63a398b8d9685e6ac7a11adds retry-safety/vector-dimension guard coverage and keeps sidecar/vector import mechanics private to the Memory Core doctor boundary.build-artifacts,check-additional-boundaries-bcd, andcheck-additional-extension-package-boundarywere all current-PR direct failures from the same import-boundary regression, not main baseline, infrastructure, flaky, or rerun-only failures.extensions/memory-core/doctor-contract-api.tsimported../../packages/memory-host-sdk/src/host/memory-schema.js, which escaped the extension package root and pulled package source into the extension TypeScript compile boundary.openclaw/plugin-sdk/memory-core-host-engine-storageprimitives./media/vdb/code/ai/aispace/openclaw-pr-95631-evidence/verification-2026-06-23-ci-round2-boundary-committed.log.Merge risk
return nullpath is the existing doctor contract for no detected legacy state. The larger diff is mostly SQLite fixture and regression coverage needed to prove the persisted-state migration boundary.openclaw update, reporter-state, and live external provider proof.