The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(sessions): accurate scope wording for tip-only resume rejections
kshitija8ccd521236b
diff --git a/hermes_cli/cli_agent_setup_mixin.py b/hermes_cli/cli_agent_setup_mixin.pyindex 97a45768525..25ec7804b92 100644--- a/hermes_cli/cli_agent_setup_mixin.py+++ b/hermes_cli/cli_agent_setup_mixin.py@@ -617,7 +617,9 @@ class CLIAgentSetupMixin:try:tip_check(self.session_id, max_messages=limit)except SessionExportTooLargeError as exc:- raise SessionResumeTooLargeError(exc.message_count, limit) from exc+ raise SessionResumeTooLargeError(+ exc.message_count, limit, scope="in its tip segment"+ ) from excelse:safety_check = getattr(self._session_db, "assert_resume_safe", None)if not callable(safety_check):diff --git a/hermes_state.py b/hermes_state.pyindex 3fc57c6defa..91727084035 100644--- a/hermes_state.py+++ b/hermes_state.py@@ -126,11 +126,16 @@ def resolved_max_export_messages() -> int:class SessionResumeTooLargeError(ValueError):- def __init__(self, message_count: int, limit: int = MAX_SAFE_RESUME_MESSAGES):+ def __init__(+ self,+ message_count: int,+ limit: int = MAX_SAFE_RESUME_MESSAGES,+ scope: str = "across its lineage",+ ):self.message_count = message_countself.limit = limitsuper().__init__(- f"session has at least {message_count} active messages across its lineage; "+ f"session has at least {message_count} active messages {scope}; "f"safe resume limit is {limit}. Export the session instead, or set ""sessions.max_resume_messages: 0 in config.yaml to disable the guard.")