You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(memory): clear summary on partial rewind too; propagate prune errors
Per-commit review of #60 surfaced two issues:
1. Partial truncation left session_summaries in place, but a rewind discards
the turns the summary was derived from — leaving stale long-term memory of
content the user edited/rolled back. Clear session_summaries (and
session_metadata) on any real truncation, partial or full, so the next
reflection rescans from a consistent state. The no-op path (keep >= 1 but
the thread has fewer user messages) is left untouched. Note this diverges
from Clear { keep_last > 0 } on purpose: compaction trims the OLD head so
the (recent-derived) summary stays valid, whereas a rewind trims the RECENT
tail and invalidates it.
2. The tool_result_cache / metadata prune used `let _ =` and swallowed errors;
a failed prune inside the transaction would still commit and leave the
thread inconsistent. Propagate with `?`.
Test now also covers summary invalidation (insert a summary, rewind, assert
gone). 6/6 memory tests green; clippy clean on memory.rs.
0 commit comments