Repository navigation
fix(memory): avoid rereading indexed chunks during provenance checks - #146494
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 12, 2026, 5:53 PM ET / 21:53 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch limits memory provenance backfills to chunks missing metadata, adds compatibility coverage, and includes the separately landed TLS shutdown registration correction. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 1 item remains The optimization remains useful and has no identified blocking defect. The previous migration-proof blocker is unwarranted: this preserves the existing storage contract and fits the documented query-plan maintenance exception. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw checks memory chunk provenance when opening or publishing its local search index. This check invalidates affected source hashes and supplies conservative metadata for legacy chunks before subsequent indexing and recall. flowchart TD
A[Open or publish memory index] --> B[Compare chunk and provenance keys]
B --> C{Missing metadata?}
C -->|No| D[Preserve existing rows]
C -->|Yes| E[Read affected chunk metadata]
E --> F[Invalidate matching source hashes]
F --> G[Insert conservative provenance]
D --> H[Continue memory processing]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +16, Tests +139. Total +155 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep provenance repair with the existing memory schema owner, using indexed missing-row selection while preserving stored values and rollback behavior. Do we have a high-confidence way to reproduce the issue? Yes, at source level: populated-index initialization reaches the existing provenance owner, whose main-branch insertion reads every chunk even when provenance is complete. No runtime reproduction was executed in this read-only review. Is this the best way to solve the issue? Yes. The patch optimizes the existing owner without adding a cache, schema, API, or alternate repair path, and its compatibility tests protect the semantics most exposed by the SQL rewrite. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5270db64d8d0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…penclaw#146494) * fix(gateway): stop TLS renewal through the shutdown owner * fix(memory): avoid rereading indexed chunks during provenance checks
TLS prerequisite: #146412 (landed on main).
Related: #130741
What Problem This Solves
Reopening a populated memory index rereads chunk payloads while ensuring provenance, even when every chunk already has provenance.
User Impact
Repeated memory index opens do less SQLite work. Existing provenance, source invalidation, and rollback behavior remain intact; no schema migration or configuration change is required.
Why This Change Was Made
Find missing provenance through the existing key indexes before reading chunk payloads, and backfill only those missing rows. This keeps the existing transaction and source-matching semantics. The first backfill of an entirely legacy index does more VM work; subsequent ensures benefit from the smaller query.
Evidence
eab7e706645cd39065c56a9e961851f5259bb899, including core and test types, lint, all three dead-export scans, and runtime guards. Independent isolated P1 review completed with no actionable findings.