fix(memory-core): keep live reindex of reset/deleted session archives#96132
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 30, 2026, 9:25 PM ET / 01:25 UTC. Summary PR surface: Source -3, Tests +153. Total +150 across 2 files. Reproducibility: yes. Source inspection shows current main returns before scheduling archive session files, while the later delta batch explicitly handles usage-counted reset/deleted archives; the PR body also provides before/after terminal proof for that listener scheduling path. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 detailsBest possible solution: Land the narrow listener guard removal with the regression test if maintainers accept focused scheduler proof, and keep gateway startup listener preloading in #76666 as separate complementary work. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows current main returns before scheduling archive session files, while the later delta batch explicitly handles usage-counted reset/deleted archives; the PR body also provides before/after terminal proof for that listener scheduling path. Is this the best way to solve the issue? Yes. Removing the listener-level archive drop is the narrowest maintainable fix because the existing downstream delta path already owns usage-counted archive indexing, and the merge result preserves current main's corpus fallback. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 201eb9cd29a1. Label changesLabel justifications:
Evidence reviewedPR surface: Source -3, Tests +153. Total +150 across 2 files. View PR surface stats
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
|
|
This pull request has been automatically marked as stale due to inactivity. |
dc14d1a to
344e7d4
Compare
The session transcript listener dropped every archive artifact before scheduling, so .jsonl.reset and .jsonl.deleted archives written by /reset and session delete were no longer indexed on the live path and only surfaced in memory search after the next gateway restart. Remove the archive guard so in-agent archives fall through to scheduleSessionDirty, which reaches the usage-counted-archive branch in processSessionDeltaBatch. Regression from openclaw#89912; restores the incremental archive indexing added in
344e7d4 to
76f0030
Compare
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(memory-core): keep live reindex of reset/deleted session archives This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(memory-core): keep live reindex of reset/deleted session archives This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Land-ready proof for exact head
The first two exact-head CI attempts exposed the same migrated memory-search fixture failures. The repair moves those fixtures to the canonical ClawSweeper's latest completed review had no rank-up moves and recommended the focused scheduler proof. A newer current-head placeholder did not produce a completed verdict or moves, so there were no additional current-head moves to apply. PR #76666 remains separate because it addresses listener attachment timing, not this archive-classification regression. Known proof gap: no live embedding-provider request or end-to-end |
|
Merged via squash.
|
…openclaw#96132) * fix(memory-core): keep live reindex of reset/deleted session archives The session transcript listener dropped every archive artifact before scheduling, so .jsonl.reset and .jsonl.deleted archives written by /reset and session delete were no longer indexed on the live path and only surfaced in memory search after the next gateway restart. Remove the archive guard so in-agent archives fall through to scheduleSessionDirty, which reaches the usage-counted-archive branch in processSessionDeltaBatch. Regression from openclaw#89912; restores the incremental archive indexing added in * fix(memory-core): constrain live archive indexing * test(memory-core): align migrated search fixtures --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where users who reset or delete a session could not find the archived conversation through live memory search until the gateway restarted. Reset/deleted transcript archives emit a session update, but memory-core discarded archive-file updates before its existing delta/index scheduling path could process them.
Why This Change Was Made
The session listener is the live bridge between transcript archive creation and memory indexing. Current
mainreturns early for archive paths even thoughprocessSessionDeltaBatchexplicitly handles usage-counted reset/deleted archives and schedules an immediate session sync.This patch admits only usage-counted session transcript filenames from the current agent's sessions directory. Reset/deleted archives now reach the existing
scheduleSessionDirtyand archive-delta path, while backup, trajectory, metadata, outside-agent, and unrecognized archive artifacts remain rejected or use the existing corpus fallback. The regression coverage lives in the existing session-sync harness and exercises the real listener, five-second debounce, dirty state, sync scheduling, and archive content indexing.PR #76666 remains separate: it addresses complementary listener-attachment timing rather than this archive-classification regression.
User Impact
Reset and deleted conversations become eligible for memory indexing while the gateway is still running, instead of remaining invisible until restart or manual reindex. There is no configuration, schema, dependency, or provider-routing change.
Evidence
Accepted exact head:
4b72c0196855261e38757a47122f09733d86f5ad.node scripts/run-vitest.mjs extensions/memory-core/src/memory/manager-sync-ops.startup-catchup.test.ts: 1 file, 21 tests passed.node scripts/run-vitest.mjs extensions/memory-core/src/memory/index.test.ts -t 'forces a rebuild after incremental writes while vectors are disabled': 1 passed.node scripts/run-vitest.mjs extensions/memory-core/src/memory/manager.legacy-migration-cleanup.test.ts: 1 passed.oxfmt --check,oxlint, andgit diff --checkon the touched files: clean.{ reason: "session-delta" }, and indexes the archive content through the existing session sync path.memory.searchconfiguration, passes the vector-enabled option through the fixture, limits the cleanup fixture to memory sources, and seeds the preexisting vector index as clean. Both failed tests pass locally after the repair.What was not tested: no live embedding-provider request or end-to-end
memory_searchquery was issued. The focused harness reaches the production listener, debounce, archive selection, and indexing-content path while replacing the final provider write with its existing capture.