fix(memory): formalize SessionMemoryObserverActor passivation protocol (#423)#428
Merged
Aaronontheweb merged 3 commits intoMar 25, 2026
Merged
Conversation
#423) Fix four bugs in the observer's interaction with the session state machine: - Add SessionPhaseChanged handler so phase notifications are no longer dead-lettered on every transition - Fix mid-distillation DistillMemories dropping the reply (parent would stall until the 5s grace period expired) - Disable observer idle timer during passivation to prevent racing with the explicit DistillMemories request - Replace DateTimeOffset.UtcNow with injected TimeProvider Expand test coverage from 2 to 7 tests covering passivation disable/re-enable, mid-distillation stash, proposal parsing, and abort recovery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionPhaseChangedmessages — observer now handles phase notifications from the parent'sTransitionTo(), entering draining mode onPassivatingand resuming on abortDistillMemoriesdropping reply — when passivation requests distillation while an idle-triggered distillation is already in-flight, the sender is stashed and receivesSessionDistillationCompleted.Emptywhen the in-flight work finishes (previously the parent would stall until the 5s grace period expired)SessionPhaseChanged(Passivating)disablesReceiveTimeout,SessionPhaseChanged(Ready)re-enables it on abortDateTimeOffset.UtcNowwithTimeProvider— injectTimeProviderinto observer constructor for testable timestampsTest plan
dotnet slopwatch analyze— no new violationsCloses #423