Repository navigation
improve(memory): reduce forget planning payloads - #147315
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 13, 2026, 3:30 PM ET / 19:30 UTC. ClawSweeper reviewWhat this changesMemory deletion planning skips fetching session bodies and unused hashes while preserving selection metadata, with regression coverage for preview results, deletion, and retained content. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, bounded optimization: current main and the latest release still materialize the unused session bodies. No blocking correctness or security defect was found. Priority: P2 Review scores
Verification
How this fits togetherMemory Core turns session selectors into a preview or deletion of derived memory artifacts. Its index planner reads the agent’s SQLite database to identify affected chunks and report deletion counts. flowchart TD
A[Memory forget command] --> B[Resolve selected sessions]
B --> C[Read index metadata]
D[Agent SQLite database] --> C
C --> E[Match paths and memory content]
E --> F[Preview report]
E --> G[Delete selected derived artifacts]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +7, Tests +78. Total +85 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the existing single-read planner and deletion owner while omitting payload that session selection never consumes. Do we have a high-confidence way to reproduce the issue? Yes, the unnecessary materialization is source-proven: current main eagerly returns session text that selection never reads. The supplied regression exercises this path, but this review did not execute it. Is this the best way to solve the issue? Yes, the projection change removes unused payload at its existing owner without introducing another query, selection policy, or persistent representation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cf45ff4d6a9c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
The compatibility proof is now explicit in the PR body. Each synthetic database is initialized through the original forget owner, then copied for original/candidate preview and deletion. All six fixtures preserve schema and typed table-state parity, and subsequent previews pass after reopening. The final idle run confirms the same behavior. No schema, stored encoding, database version, migration, or writer changes are introduced, so no data conversion is required. This addresses the data-model compatibility checklist item; the final idle measurements are also recorded in the body. |
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
Related: #146197
What Problem This Solves
Memory deletion previews and forget operations fetch large session bodies that their index planner never uses.
User Impact
Forgetting memory from session-heavy indexes requires much less payload materialization. Preview results, retained content, deletion selection and retry behavior stay unchanged. No migration or configuration change is needed. Small and all-memory workloads may be neutral or slower.
Why This Change Was Made
Keep the existing single index read and all selection metadata, while asking SQLite to return an empty body for session-source chunks. Full memory and unusual-source bodies remain available to the existing selection logic. The planner also stops fetching unused hashes.
Evidence
sqlite_schemaand typed table-state parity, and passes a subsequent preview after reopening. This is a read projection change with no schema, stored encoding, version, migration, or writer change; no data conversion is required.