The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(hermes_cli): setup cluster — extract _prompt_session_reset, template migration summary lines
Teknium91d144f770f6
diff --git a/hermes_cli/setup.py b/hermes_cli/setup.pyindex 97b9ea1a987..292250a2c82 100644--- a/hermes_cli/setup.py+++ b/hermes_cli/setup.py@@ -503,19 +503,20 @@ def setup_agent_settings(config: dict):# ── Session Reset Policy ──print_header("Session Reset Policy")_info(*_SESSION_RESET_HELP)+ _prompt_session_reset(config.setdefault("session_reset", {}))+ save_config(config)- current_policy = config.get("session_reset", {})- current_mode = current_policy.get("mode", "none")- current_idle = current_policy.get("idle_minutes", 1440)- current_hour = current_policy.get("at_hour", 4)+def _prompt_session_reset(reset_cfg: dict) -> None:+ """Pick the session reset mode and its idle/daily parameters in place."""+ current_mode = reset_cfg.get("mode", "none")+ current_idle, current_hour = reset_cfg.get("idle_minutes", 1440), reset_cfg.get("at_hour", 4)default_reset = _SESSION_RESET_MODES.index(current_mode) if current_mode in _SESSION_RESET_MODES else 3reset_idx = prompt_choice("Session reset mode:", _SESSION_RESET_CHOICES, default_reset)-- reset_cfg = config.setdefault("session_reset", {})mode = _SESSION_RESET_MODES[reset_idx] if 0 <= reset_idx < len(_SESSION_RESET_MODES) else None- if mode is not None:- reset_cfg["mode"] = mode+ if mode is None: # keep current settings+ return+ reset_cfg["mode"] = modeif mode in ("both", "idle"):_prompt_int_setting(reset_cfg, "idle_minutes", " Inactivity timeout (minutes)", current_idle, lambda v: v > 0)if mode in ("both", "daily"):@@ -524,15 +525,13 @@ def setup_agent_settings(config: dict):if mode == "none":print_info("Sessions will never auto-reset. Context is managed only by compression.")print_warning("Long conversations will grow in cost. Use /reset manually when needed.")- elif mode is not None:+ else:print_success({"both": f"Sessions reset after {idle_now} min idle or daily at {hour_now}:00","idle": f"Sessions reset after {idle_now} min of inactivity","daily": f"Sessions reset daily at {hour_now}:00",}[mode])- save_config(config)-# ── Section 5: Tool Configuration (delegates to unified tools_config.py) ──diff --git a/hermes_cli/setup_migration.py b/hermes_cli/setup_migration.pyindex 3332a1432dd..3cf0870bbb2 100644--- a/hermes_cli/setup_migration.py+++ b/hermes_cli/setup_migration.py@@ -315,18 +315,17 @@ def _offer_openclaw_migration(hermes_home: Path) -> bool:return Falsesummary = report.get("summary", {})- migrated, skipped = summary.get("migrated", 0), summary.get("skipped", 0)- conflicts, errors = summary.get("conflict", 0), summary.get("error", 0)print()- for count, printer, text in (- (migrated, print_success, f"Imported {migrated} item(s) from OpenClaw."),- (conflicts, print_info,- f"Skipped {conflicts} item(s) that already exist in Hermes (use hermes claw migrate --overwrite to force)."),- (skipped, print_info, f"Skipped {skipped} item(s) (not found or unchanged)."),- (errors, print_warning, f"{errors} item(s) had errors — check the migration report."),+ for key, printer, text in (+ ("migrated", print_success, "Imported {n} item(s) from OpenClaw."),+ ("conflict", print_info,+ "Skipped {n} item(s) that already exist in Hermes (use hermes claw migrate --overwrite to force)."),+ ("skipped", print_info, "Skipped {n} item(s) (not found or unchanged)."),+ ("error", print_warning, "{n} item(s) had errors — check the migration report."),):+ count = summary.get(key, 0)if count:- printer(text)+ printer(text.format(n=count))output_dir = report.get("output_dir")if output_dir: