Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/memory/supermemory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def _run():
self._sync_thread.start()

def on_session_end(self, messages: List[Dict[str, Any]]) -> None:
if not self._active or not self._write_enabled or not self._client or not self._session_id:
if not self._active or not self._auto_capture or not self._write_enabled or not self._client or not self._session_id:
return
cleaned = []
for message in messages or []:
Expand Down
15 changes: 15 additions & 0 deletions tests/plugins/memory/test_supermemory_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ def test_on_session_end_ingests_clean_messages(provider):
]


def test_on_session_end_respects_auto_capture_false(monkeypatch, tmp_path):
monkeypatch.setenv("SUPERMEMORY_API_KEY", "test-key")
monkeypatch.setattr("plugins.memory.supermemory._SupermemoryClient", FakeClient)
_save_supermemory_config({"auto_capture": False}, str(tmp_path))
p = SupermemoryMemoryProvider()
p.initialize("session-1", hermes_home=str(tmp_path), platform="cli")

p.on_session_end([
{"role": "user", "content": "please keep this out of automatic capture"},
{"role": "assistant", "content": "this should not be ingested either"},
])

assert p._client.ingest_calls == []


def test_on_memory_write_tracks_thread(provider):
provider.on_memory_write("add", "memory", "Jordan likes concise docs")
assert provider._write_thread is not None
Expand Down