fix: bound memory capture and recall output - #21692
Open
xdeepsnyx wants to merge 1 commit into
Open
Conversation
19 tasks
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for addressing both Supermemory capture controls and recall growth.
Problems
capture_mode: explicitis preserved and skipssync_turn, but the changedon_session_end()guard only adds_auto_capture; withauto_capture=true, explicit mode still callsingest_conversation()automatically (plugins/memory/supermemory/__init__.py, changed session-end guard; current equivalent at :720-744).- The new
session_searchcap is applied only to browse/discovery returns. Current routing returns_scroll()and_read_session()directly (tools/session_search_tool.py:678-739), leaving those message-bearing paths unbounded. - The session-search test is based on
_summarize_session, which current main no longer contains; current main uses the four-shape dispatcher attools/session_search_tool.py:619-740.
Suggested changes
- Apply one automatic-capture predicate, including explicit mode, to every automatic ingest path and test session-end behavior.
- Bound all four session-search shapes using valid structured output and truncation metadata, then test oversized read and scroll results.
Automated hermes-sweeper review.
| @@ -593,7 +601,7 @@ def _run(): | |||
| self._sync_thread.start() | |||
Contributor
There was a problem hiding this comment.
This guard still permits automatic session-end ingest when capture_mode == "explicit" and auto_capture is true. If explicit means explicit writes only, include that mode here as well and add a session-end regression test.
| @@ -265,6 +266,10 @@ async def _summarize_session( | |||
| _HIDDEN_SESSION_SOURCES = ("tool",) | |||
|
|
|||
|
|
|||
Contributor
There was a problem hiding this comment.
This helper is only used for browse/discovery returns in this patch; the scroll and read shapes still return unbounded payloads. Apply the boundary policy to every session_search shape and preserve valid structured output after truncation.
jkobject
added a commit
to jkobject/hermes-agent
that referenced
this pull request
Jul 21, 2026
Prevent every automatic session-ingest boundary from uploading content when auto_capture is false, while leaving explicit memory writes available. Carries the privacy behavior from installed commit 6830f77 and the independently proposed guard in NousResearch#21692. Co-authored-by: Nyx <nyx@users.noreply.github.com>
This was referenced Aug 4, 2026
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
Motivation
Provider-backed memory can become counterproductive if automatic capture ignores conservative settings or if recall/search payloads grow large enough to flood active context. This PR keeps curated memory useful while bounding automatic ingestion and recall output.
Changes
memory.auto_capture: falsenow gates Supermemoryon_session_endingestion.capture_mode: explicitis preserved by config normalization and skips automatic turn capture.saved_at,platform, andoriginwhere available.truncatedflag.memory.search_result_char_limitwith a default of 10,000 characters.tools.memory_search_capsto cap memory/search-style tool results with a visible truncation notice.session_searchand memory-provider search/profile/recall-like tools.Test plan
env -u SUPERMEMORY_CONTAINER_TAG \ -u SUPERMEMORY_CUSTOM_CONTAINERS \ -u SUPERMEMORY_ENABLE_CUSTOM_CONTAINER_TAGS \ python -m pytest \ tests/plugins/memory/test_supermemory_provider.py \ tests/tools/test_session_search.py \ -o 'addopts=' -qResult:
72 passed in 1.85sCloses #21690