Repository navigation
fix(memory): preserve rotated recall and simplify consolidation - #137967
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 5:09 AM ET / 09:09 UTC. ClawSweeper reviewWhat this changesRepairs Active Memory recall after canonical SQLite session rotation, preserves stored recall-audit timestamps, and consolidates memory implementation paths around validated host-owned operations. Merge readiness⛔ Blocked before merge - 1 item remains Pass: the patch follows the canonical SQLite transcript identity and moves consolidation composition to the existing locked owner; no introduced correctness or security defect was identified. Priority: P2 Review scores
Verification
How this fits togetherActive Memory launches a bounded helper run whose transcript evidence becomes context for the next agent turn. Memory Core later promotes validated recall evidence into long-term MEMORY.md; this change keeps both flows on their canonical state owners. flowchart LR
A[User turn] --> B[Active Memory recall]
B --> C[SQLite transcript identity]
C --> D[Recall evidence and context]
D --> E[Short-term promotion]
E --> F[Dreaming consolidation plan]
F --> G[Validated MEMORY.md update]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -759, Tests -242, Docs +2, Other 0. Total -999 across 34 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep the canonical transcript-target and host-composed consolidation flow, with the focused rotation, audit, project-isolation, and bounded-output regressions retained. Do we have a high-confidence way to reproduce the issue? Yes. The source establishes a deterministic canonical-session-key successor path, and focused Active Memory and short-term-promotion regressions cover it; this review did not execute the suite. Is this the best way to solve the issue? Yes. Reusing session-target identity and the existing locked document composer removes the filename path and avoids accepting model-authored replacement memory. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 766ae8ce99a8. LabelsLabel changes:
Label 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)
|
|
@clawsweeper re-review Please review final head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The remaining compatibility checklist item is covered by the PR body's Data compatibility proof table. I checked the flagged readers against base The real seeded-state add/merge run preserved unrelated entries and the saved audit timestamp, and both canonical-key and SQLite-marker session rotation cases passed. This is a consumer/owner refactor with unchanged tables, serializers, versions, and persistence semantics, so no migration is needed. No rank-up item remains unaddressed; final-head CI is green. |
|
Merged via squash.
|
…claw#137967) * refactor(memory): simplify recall and consolidation owners * test(memory): isolate recall state and timeout clocks * test(memory): await callback transcript before timing out
What Problem This Solves
Active Memory could report no relevant memory after a SQLite session rotation because it treated the returned canonical session key as a filename. Recall audit also reported the current time instead of the saved update time.
This fixes both bugs and removes duplicate memory implementation paths, building on #137894.
Why This Change Was Made
Recall now reads canonical transcript targets and validated successors directly. Dreaming returns consolidation decisions; the host already owns sourced document composition and locked application, so generating a second full document was redundant. Embedding completions update failure state synchronously in their owner, replacing copied reducer state and a Promise mutex. The remaining cleanup removes duplicate retries, wiki metadata projection, and unused private host helpers.
User Impact
Recall evidence and unavailable-memory warnings survive session rotation; audit timestamps reflect saved state. Consolidation emits less model output. Timeout recovery, optional transcript exports, archives, provider fallback, sourced entries, project boundaries and raw/compiled wiki ranking remain supported.
Net −999 lines: production +223/−982 (−759); tests/support +576/−818 (−242); docs +8/−6. No configuration/default, public SDK, schema, migration, stored-format or retention changes.
Evidence
memory index/search/statuswith no fallback; both LanceDB/OpenAI live tests passed.Live proof used an isolated Blacksmith Testbox; the lease is stopped. Test fixture repairs close cached SQLite handles, reset queued one-shot mocks, and coordinate the existing clocks with actual start/write boundaries. Timeout budgets and behavior assertions remain intact.
Data compatibility proof
Addressing ClawSweeper's compatibility request: flagged consumers do not change the stored data model.
src/stateandsrc/sessions, including schemas, versions, openers, migrations and transcript storage, are byte-identical to base3b710e4b75c. Recall changes which existing validated identity it reads. Both real SQLite rotation forms pass.short-term-promotion-store.tsonly exports its existing reader; namespaces, version, records, metadata and writer are unchanged. Canonicalshort-term-promotion-apply.tsis identical to base. Live seeded-state add/merge preserves unrelated entries and the saved audit timestamp.git diff --exit-codeverified the named unchanged owners against base. There are no new tables, columns, indexes, serializers, schema versions or persistence policies, so no migration is required.Two separate follow-ups are recorded: invalid plugin config can appear as an unknown CLI command (
src/plugins/cli.ts); an intermittent teardown stall inserver-plugins.lifecycle.test.ts:185needs shutdown-stage diagnostics if it recurs. Neither required a speculative production patch in this memory refactor.