Bug Description
The MemoryProvider ABC defines on_turn_start(turn_number, message, **kwargs) (agent/memory_provider.py line 144) and memory_manager.py has a complete dispatch method that iterates providers and calls it (lines 265-277). However, run_agent.py never calls memory_manager.on_turn_start() anywhere.
This means _turn_count stays at 0 in every memory plugin that relies on it.
Steps to Reproduce
- Enable Honcho with
dialectic_cadence or injection_frequency set to any value > 1
- Have a multi-turn conversation (5+ turns)
- Observe via DEBUG logging that Honcho's
on_turn_start() is never called
- Observe that
_turn_count remains 0 throughout the session
Quick verification:
grep -n "on_turn_start" run_agent.py
# Returns no results — the call is missing entirely
Expected Behavior
memory_manager.on_turn_start() should be called once per user turn, after the turn counter is incremented, so that memory plugins can track turn progression and gate behavior (e.g., Honcho's cadence logic, Supermemory's turn tracking).
Actual Behavior
The hook is never invoked. All plugins that implement on_turn_start() have their turn-tracking fields stuck at their initial value (0).
Affected plugins:
- Honcho (
plugins/memory/honcho/__init__.py lines 516-518): Sets self._turn_count = turn_number. Used in queue_prefetch() (lines 485-490) for dialectic_cadence and injection_frequency checks — both broken.
- Supermemory (
plugins/memory/supermemory/__init__.py lines 527-528): Sets self._turn_count = max(turn_number, 0) — never called.
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)
The hook was defined in the ABC and dispatch was implemented in memory_manager.py, but the call was never wired into the main agent loop in run_agent.py. The natural insertion point is after self._user_turn_count += 1 (line 7156), where the agent already tracks turn progression.
The infrastructure is complete — the only missing piece is the single call from run_agent.py.
Proposed Fix (optional)
Add the call in run_agent.py after line 7156 (self._user_turn_count += 1):
if self._memory_manager:
try:
self._memory_manager.on_turn_start(
self._user_turn_count,
user_message if isinstance(user_message, str) else str(user_message),
platform=getattr(self, '_platform', None),
model=self._current_model if hasattr(self, '_current_model') else self.model,
tool_count=len(self.valid_tool_names) if hasattr(self, 'valid_tool_names') else 0,
)
except Exception:
pass
PR incoming.
Bug Description
The
MemoryProviderABC defineson_turn_start(turn_number, message, **kwargs)(agent/memory_provider.pyline 144) andmemory_manager.pyhas a complete dispatch method that iterates providers and calls it (lines 265-277). However,run_agent.pynever callsmemory_manager.on_turn_start()anywhere.This means
_turn_countstays at 0 in every memory plugin that relies on it.Steps to Reproduce
dialectic_cadenceorinjection_frequencyset to any value > 1on_turn_start()is never called_turn_countremains 0 throughout the sessionQuick verification:
Expected Behavior
memory_manager.on_turn_start()should be called once per user turn, after the turn counter is incremented, so that memory plugins can track turn progression and gate behavior (e.g., Honcho's cadence logic, Supermemory's turn tracking).Actual Behavior
The hook is never invoked. All plugins that implement
on_turn_start()have their turn-tracking fields stuck at their initial value (0).Affected plugins:
plugins/memory/honcho/__init__.pylines 516-518): Setsself._turn_count = turn_number. Used inqueue_prefetch()(lines 485-490) fordialectic_cadenceandinjection_frequencychecks — both broken.plugins/memory/supermemory/__init__.pylines 527-528): Setsself._turn_count = max(turn_number, 0)— never called.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)
The hook was defined in the ABC and dispatch was implemented in
memory_manager.py, but the call was never wired into the main agent loop inrun_agent.py. The natural insertion point is afterself._user_turn_count += 1(line 7156), where the agent already tracks turn progression.The infrastructure is complete — the only missing piece is the single call from
run_agent.py.Proposed Fix (optional)
Add the call in
run_agent.pyafter line 7156 (self._user_turn_count += 1):PR incoming.