Bug Description
run_agent.py line 6081 calls self._memory_manager.on_pre_compress(messages) as a bare statement, discarding the return value. The memory_manager.on_pre_compress() method correctly collects text from all providers and returns it as a combined string (joined with "\n\n"), but this text is never passed to the compressor.
Additionally, context_compressor.compress() and _generate_summary() have no parameter to accept memory provider context, so even capturing the return value has nowhere to go without updating those signatures.
This affects all MemoryProvider plugins (Honcho, Holographic, Mem0, Supermemory, RetainDB, and any third-party plugins).
Steps to Reproduce
- Implement a MemoryProvider that returns non-empty text from
on_pre_compress()
- Trigger context compression (long conversation or
/compress)
- Observe via DEBUG logging that the provider's
on_pre_compress() returns text
- Observe that the returned text never appears in the compression summary
Expected Behavior
Text returned by MemoryProvider.on_pre_compress() should be injected into the compression summary prompt so the compressor preserves provider-extracted insights (as documented in the ABC docstring and memory_manager.on_pre_compress() return-value docstring).
Actual Behavior
The return value is silently discarded. The hook only works as a notification (observe messages before they're discarded), not as the injection point it was designed to be.
Affected Component
Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
N/A (CLI only)
Operating System
macOS 15.6.1
Python Version
3.11.14
Hermes Version
v0.8.0
Root Cause Analysis (optional)
Three-part gap:
- Call site (
run_agent.py line 6081): self._memory_manager.on_pre_compress(messages) is called as a statement — the return value is not captured.
- compress() signature (
agent/context_compressor.py line 612): compress(self, messages, current_tokens=None) has no parameter to accept memory context.
- _generate_summary() (
agent/context_compressor.py line 287): No mechanism to inject provider insights into the summarization template.
The dispatch layer (memory_manager.py lines 290-307) is correct — it collects provider contributions and returns a combined string. The bug is entirely at the caller and consumer level.
Proposed Fix (optional)
- Capture the return value in
run_agent.py
- Add
memory_context: str = "" parameter to compress() and _generate_summary()
- Inject a "MEMORY PROVIDER INSIGHTS" section into the summarization prompt when non-empty
PR incoming.
Bug Description
run_agent.pyline 6081 callsself._memory_manager.on_pre_compress(messages)as a bare statement, discarding the return value. Thememory_manager.on_pre_compress()method correctly collects text from all providers and returns it as a combined string (joined with"\n\n"), but this text is never passed to the compressor.Additionally,
context_compressor.compress()and_generate_summary()have no parameter to accept memory provider context, so even capturing the return value has nowhere to go without updating those signatures.This affects all MemoryProvider plugins (Honcho, Holographic, Mem0, Supermemory, RetainDB, and any third-party plugins).
Steps to Reproduce
on_pre_compress()/compress)on_pre_compress()returns textExpected Behavior
Text returned by
MemoryProvider.on_pre_compress()should be injected into the compression summary prompt so the compressor preserves provider-extracted insights (as documented in the ABC docstring andmemory_manager.on_pre_compress()return-value docstring).Actual Behavior
The return value is silently discarded. The hook only works as a notification (observe messages before they're discarded), not as the injection point it was designed to be.
Affected Component
Agent Core (conversation loop, context compression, memory)
Messaging Platform (if gateway-related)
N/A (CLI only)
Operating System
macOS 15.6.1
Python Version
3.11.14
Hermes Version
v0.8.0
Root Cause Analysis (optional)
Three-part gap:
run_agent.pyline 6081):self._memory_manager.on_pre_compress(messages)is called as a statement — the return value is not captured.agent/context_compressor.pyline 612):compress(self, messages, current_tokens=None)has no parameter to accept memory context.agent/context_compressor.pyline 287): No mechanism to inject provider insights into the summarization template.The dispatch layer (
memory_manager.pylines 290-307) is correct — it collects provider contributions and returns a combined string. The bug is entirely at the caller and consumer level.Proposed Fix (optional)
run_agent.pymemory_context: str = ""parameter tocompress()and_generate_summary()PR incoming.