Repository navigation
fix(memory): reuse targeted session corpus snapshot - #117247
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 3:33 AM ET / 07:33 UTC. ClawSweeper reviewWhat this changesThe PR resolves targeted session files and indexes them from one prepared transcript-corpus snapshot, preventing a session-store rotation between those two steps from changing the indexed identity and avoiding corpus discovery for ordinary no-session-work syncs. Merge readinessNo blocking correctness or security findings. This is a focused Memory Core bug fix with source-backed snapshot ownership, a targeted store-rotation regression test, successful proof/quality gates, and no overlap with the current main branch’s memory paths; keep it open for explicit maintainer acceptance because it carries the Priority: P2 Review scores
Verification
How this fits togetherMemory Core builds the local search index from workspace files and agent session transcripts. A targeted session sync resolves a requested session to corpus entries, passes those entries into archive indexing, and then updates the memory index without re-reading the session corpus. flowchart LR
A[Targeted session request] --> B[Resolve transcript corpus]
B --> C[Prepared corpus snapshot]
C --> D[Resolve target archive files]
C --> E[Archive-file indexing]
D --> E
E --> F[Local memory search index]
Decision needed
Why: The patch is technically sound and proof-positive, but the repository’s protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +68. Total +67 across 9 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused owner-boundary repair after the maintainer confirms the current merge result; retain the one-snapshot contract and its SQLite store-rotation regression coverage. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible with high confidence: the changed harness rotates the SQLite session store after the sole corpus enumeration and verifies that indexing keeps the original session content. Is this the best way to solve the issue? Yes: resolving and consuming the targeted corpus at the manager session/source-sync boundary is the narrow canonical fix; re-enumerating downstream or caching broader corpus state would preserve the race or widen lifecycle scope unnecessarily. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against edfeec49e7a7. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
c88e957 to
236a992
Compare
236a992 to
32e7ea9
Compare
|
Merged via squash.
|
* origin/main: (41 commits) test(ci): update memory helper routing expectation (#117295) fix(canvas): emit successful control results in JSON mode (#117297) fix(imessage): settle native inbound reply delivery (#117282) fix(agents): reject invalid UTF-8 LSP responses (#117271) fix(line): centralize card and template message alt text (#117280) fix(release): validate candidates before Docker publication (#117252) fix(media): validate provider-owned generated media downloads (#117281) fix(feishu): restore custom HTTPS API domains (#117278) fix(models): reuse prepared plugin metadata (#117131) fix(agents): stop fallback after delivered-but-failed attempts (#114628) fix(memory): reuse targeted session corpus snapshot (#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (#116931) fix(linux-canvas): report socket watcher fallback (#109502) fix(codex): preserve authoritative turn completion (#117185) fix(canvas): preserve widgets across derived-name collisions (#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (#117206) fix(msteams): prevent duplicate final replies (#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (#117221) fix(plugins): preserve workspace plugins across CLI and control UI (#117265) ...
* origin/main: (41 commits) test(ci): update memory helper routing expectation (openclaw#117295) fix(canvas): emit successful control results in JSON mode (openclaw#117297) fix(imessage): settle native inbound reply delivery (openclaw#117282) fix(agents): reject invalid UTF-8 LSP responses (openclaw#117271) fix(line): centralize card and template message alt text (openclaw#117280) fix(release): validate candidates before Docker publication (openclaw#117252) fix(media): validate provider-owned generated media downloads (openclaw#117281) fix(feishu): restore custom HTTPS API domains (openclaw#117278) fix(models): reuse prepared plugin metadata (openclaw#117131) fix(agents): stop fallback after delivered-but-failed attempts (openclaw#114628) fix(memory): reuse targeted session corpus snapshot (openclaw#117247) fix(matrix): reconcile durable sends after response loss test(release): repair full validation regressions (openclaw#116931) fix(linux-canvas): report socket watcher fallback (openclaw#109502) fix(codex): preserve authoritative turn completion (openclaw#117185) fix(canvas): preserve widgets across derived-name collisions (openclaw#117132) fix(channels): config validation rejects documented channels.<id>.configWrites on 13 channels (openclaw#117206) fix(msteams): prevent duplicate final replies (openclaw#116398) fix(doctor): session SQLite restore installs an empty session index over the valid archive (openclaw#117221) fix(plugins): preserve workspace plugins across CLI and control UI (openclaw#117265) ...
What Problem This Solves
Targeted memory session sync resolved a requested session against one transcript-corpus enumeration, then enumerated the corpus again during indexing. A session-store reset or configuration rotation between those reads could make the chosen identity disappear or be materialized from a different store. Ordinary syncs also paid for corpus discovery during preflight even when there was no session work.
Why This Change Was Made
.dreams/session-corpus, Doctor repair, SQLite schema, config/provider contracts, and persistent user data. The dreaming corpus has shipped citation and repair semantics and is not safe to remove without a dedicated migration.Architectural owner: memory-core's manager session/source sync boundary. The canonical repair resolves and indexes a targeted session from one prepared corpus snapshot; no fallback or parallel storage path was added.
Production delta: 43 additions, 55 deletions (net -12). Tests/helpers: 105 additions, 26 deletions (net +79).
User Impact
Targeted session indexing remains consistent if the configured SQLite session store rotates while a sync is starting. Ordinary memory syncs avoid an unnecessary session-corpus scan when no target or session indexing work exists. Full reindex, restart/catch-up, archived/reset session, dreaming, backfill, repair, redaction, and provenance behavior remain unchanged.
Evidence
tbx_01kyxykp86qbdw81fgsv51eszb: the same 9 files / 127 tests passed, including a real SQLite store A→B rotation during actualrunSync; indexing retained store A's resolved snapshot and rejected store B's replacement content.maintimed out in 339.9s locally and 170.9s on Testbox in the first affected fixture. The shared test-config owner now defaults only an omittedplugins.enabledtofalse; it preserves every explicitpluginsfield, includingenabled, entries, allowlists, slots, and load settings. The tools fixture uses that owner centrally, and recall tracking no longer carries a duplicate config cast. Provider-auto behavior, explicit dreaming config, real SQLite/self-heal and recall-persistence assertions, timeouts, mocks, and production behavior remain unchanged.tbx_01kyy2mby6xkk1cprx6rj42mhe(Actions run).runSync({ reason: "session-delta" })path records zero corpus enumerations when index identity is valid and no session work is dirty.node scripts/check-changed.mjs -- <nine changed files>passed on Blacksmith Testboxtbx_01kyy302zc2ycqbdw65140mxxh: formatting, API/boundary/dead-export guards, extension and extension-test tsgo, lint, database-first guards, and runtime import cycles (Actions run).git diff --checkpassed.