The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(honcho): delegate _is_trivial_prompt wholly to the shared classifier
kshitijk4poor34d6095e41c1
diff --git a/plugins/memory/honcho/__init__.py b/plugins/memory/honcho/__init__.pyindex d6a2d3f806e..78d24e90b3d 100644--- a/plugins/memory/honcho/__init__.py+++ b/plugins/memory/honcho/__init__.py@@ -23,7 +23,7 @@ import timefrom typing import Any, Callable, Dict, List, Optionalfrom agent.memory_manager import sanitize_context-from agent.memory_provider import TRIVIAL_PROMPT_RE, MemoryProvider+from agent.memory_provider import TRIVIAL_PROMPT_RE, MemoryProvider, is_trivial_promptfrom tools.registry import tool_errorlogger = logging.getLogger(__name__)@@ -1198,24 +1198,15 @@ class HonchoMemoryProvider(MemoryProvider):# Prompts that carry no semantic signal — trivial acknowledgements, greetings,# slash commands, empty input. Skipping injection here saves tokens and prevents- # stale user-model context from derailing one-word replies. The pattern is- # shared with the core prefetch gate (agent/memory_provider.TRIVIAL_PROMPT_RE)- # so the provider-side classifier and the core gate can never drift apart.+ # stale user-model context from derailing one-word replies. Classification is+ # fully delegated to the shared agent/memory_provider.is_trivial_prompt so the+ # provider-side classifier and the core prefetch gate can never drift apart._TRIVIAL_PROMPT_RE = TRIVIAL_PROMPT_RE@classmethoddef _is_trivial_prompt(cls, text: str) -> bool:"""Return True if the prompt is too trivial to warrant context injection."""- if not text:- return True- stripped = text.strip()- if not stripped:- return True- if stripped.startswith("/"):- return True- if cls._TRIVIAL_PROMPT_RE.match(stripped):- return True- return False+ return is_trivial_prompt(text)def on_turn_start(self, turn_number: int, message: str, **kwargs) -> None:"""Track turn count for cadence and injection_frequency logic."""