fix(supermemory): honor auto_capture during session-end flush - #24136
Closed
paulb26 wants to merge 1 commit into
Closed
fix(supermemory): honor auto_capture during session-end flush#24136paulb26 wants to merge 1 commit into
paulb26 wants to merge 1 commit into
Conversation
Collaborator
|
Duplicate of #21692 — the exact same |
paulb26
force-pushed
the
fix/supermemory-session-auto-capture
branch
from
May 12, 2026 03:27
b786580 to
6afe575
Compare
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.
Problem statement
When Supermemory is enabled but
auto_captureis disabled, Hermes should not automatically persist conversation content. Turn-level capture already respects this setting, but the session-end flush path still ingests the full cleaned conversation.In practice, this can persist private session context even when the user explicitly disabled automatic capture. That stored context can later be recalled and included in outbound chat replies, creating an unexpected privacy leak.
Root cause
SupermemoryMemoryProvider.sync_turn()correctly checks_auto_capturebefore writing conversation turns.SupermemoryMemoryProvider.on_session_end()did not. It only checked active/write/client/session state, so disablingauto_capturestopped per-turn capture but did not stop end-of-session ingestion.Fix approach
_auto_captureto the early-return guard inon_session_end().auto_capture: False.ingest_conversation()call when automatic capture is disabled.Test coverage
Added test in
tests/plugins/memory/test_supermemory_provider.py:test_on_session_end_respects_auto_capture_falseauto_capture: False, callson_session_end()with user/assistant messages, and verifies the fake client receives no ingestion call.Existing coverage still verifies the enabled path:
test_on_session_end_ingests_clean_messagesTargeted test command:
Risk assessment
Low risk. This only changes behavior when
auto_captureis disabled, aligning the session-end path with the documented meaning of that setting and with the existingsync_turn()behavior. Explicit memory writes are unaffected. Auto-recall is unaffected. Users who intentionally disabled turn capture but still expected whole-session capture would see less automatic persistence, but that split behavior is surprising and privacy-hostile.