diff --git a/hermes_cli/cli_agent_setup_mixin.py b/hermes_cli/cli_agent_setup_mixin.py index 97a4576852..25ec7804b9 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 exc else: safety_check = getattr(self._session_db, "assert_resume_safe", None) if not callable(safety_check): diff --git a/hermes_state.py b/hermes_state.py index 3fc57c6def..9172708403 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_count self.limit = limit super().__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." )