Merge branch 'main' into codex/align-codex-provider-conventions-mainrepo

This commit is contained in:
Teknium 2026-02-28 18:13:38 -08:00 committed by GitHub
commit 5a79e423fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
96 changed files with 10884 additions and 447 deletions

View file

@ -1060,6 +1060,14 @@ def run_setup_wizard(args):
print_success("Terminal set to SSH")
# else: Keep current (selected_backend is None)
# Sync terminal backend to .env so terminal_tool picks it up directly.
# config.yaml is the source of truth, but terminal_tool reads TERMINAL_ENV.
if selected_backend:
save_env_value("TERMINAL_ENV", selected_backend)
docker_image = config.get('terminal', {}).get('docker_image')
if docker_image:
save_env_value("TERMINAL_DOCKER_IMAGE", docker_image)
# =========================================================================
# Step 5: Agent Settings
# =========================================================================
@ -1081,27 +1089,25 @@ def run_setup_wizard(args):
except ValueError:
print_warning("Invalid number, keeping current value")
# Tool progress notifications (for messaging)
# Tool progress notifications
print_info("")
print_info("Tool Progress Notifications (Messaging only)")
print_info("Send status messages when the agent uses tools.")
print_info("Example: '💻 ls -la...' or '🔍 web_search...'")
print_info("Tool Progress Display")
print_info("Controls how much tool activity is shown (CLI and messaging).")
print_info(" off — Silent, just the final response")
print_info(" new — Show tool name only when it changes (less noise)")
print_info(" all — Show every tool call with a short preview")
print_info(" verbose — Full args, results, and debug logs")
current_progress = get_env_value('HERMES_TOOL_PROGRESS') or 'true'
if prompt_yes_no("Enable tool progress messages?", current_progress.lower() in ('1', 'true', 'yes')):
save_env_value("HERMES_TOOL_PROGRESS", "true")
# Progress mode
current_mode = get_env_value('HERMES_TOOL_PROGRESS_MODE') or 'all'
print_info(" Mode options:")
print_info(" 'new' - Only when switching tools (less spam)")
print_info(" 'all' - Every tool call")
mode = prompt(" Progress mode", current_mode)
if mode.lower() in ('all', 'new'):
save_env_value("HERMES_TOOL_PROGRESS_MODE", mode.lower())
print_success("Tool progress enabled")
current_mode = config.get("display", {}).get("tool_progress", "all")
mode = prompt("Tool progress mode", current_mode)
if mode.lower() in ("off", "new", "all", "verbose"):
if "display" not in config:
config["display"] = {}
config["display"]["tool_progress"] = mode.lower()
save_config(config)
print_success(f"Tool progress set to: {mode.lower()}")
else:
save_env_value("HERMES_TOOL_PROGRESS", "false")
print_warning(f"Unknown mode '{mode}', keeping '{current_mode}'")
# =========================================================================
# Step 6: Context Compression
@ -1123,6 +1129,82 @@ def run_setup_wizard(args):
print_success(f"Context compression threshold set to {config['compression'].get('threshold', 0.85)}")
# =========================================================================
# Step 6b: Session Reset Policy (Messaging)
# =========================================================================
print_header("Session Reset Policy")
print_info("Messaging sessions (Telegram, Discord, etc.) accumulate context over time.")
print_info("Each message adds to the conversation history, which means growing API costs.")
print_info("")
print_info("To manage this, sessions can automatically reset after a period of inactivity")
print_info("or at a fixed time each day. When a reset happens, the agent saves important")
print_info("things to its persistent memory first — but the conversation context is cleared.")
print_info("")
print_info("You can also manually reset anytime by typing /reset in chat.")
print_info("")
reset_choices = [
"Inactivity + daily reset (recommended — reset whichever comes first)",
"Inactivity only (reset after N minutes of no messages)",
"Daily only (reset at a fixed hour each day)",
"Never auto-reset (context lives until /reset or context compression)",
"Keep current settings",
]
current_policy = config.get('session_reset', {})
current_mode = current_policy.get('mode', 'both')
current_idle = current_policy.get('idle_minutes', 1440)
current_hour = current_policy.get('at_hour', 4)
default_reset = {"both": 0, "idle": 1, "daily": 2, "none": 3}.get(current_mode, 0)
reset_idx = prompt_choice("Session reset mode:", reset_choices, default_reset)
config.setdefault('session_reset', {})
if reset_idx == 0: # Both
config['session_reset']['mode'] = 'both'
idle_str = prompt(" Inactivity timeout (minutes)", str(current_idle))
try:
idle_val = int(idle_str)
if idle_val > 0:
config['session_reset']['idle_minutes'] = idle_val
except ValueError:
pass
hour_str = prompt(" Daily reset hour (0-23, local time)", str(current_hour))
try:
hour_val = int(hour_str)
if 0 <= hour_val <= 23:
config['session_reset']['at_hour'] = hour_val
except ValueError:
pass
print_success(f"Sessions reset after {config['session_reset'].get('idle_minutes', 1440)} min idle or daily at {config['session_reset'].get('at_hour', 4)}:00")
elif reset_idx == 1: # Idle only
config['session_reset']['mode'] = 'idle'
idle_str = prompt(" Inactivity timeout (minutes)", str(current_idle))
try:
idle_val = int(idle_str)
if idle_val > 0:
config['session_reset']['idle_minutes'] = idle_val
except ValueError:
pass
print_success(f"Sessions reset after {config['session_reset'].get('idle_minutes', 1440)} min of inactivity")
elif reset_idx == 2: # Daily only
config['session_reset']['mode'] = 'daily'
hour_str = prompt(" Daily reset hour (0-23, local time)", str(current_hour))
try:
hour_val = int(hour_str)
if 0 <= hour_val <= 23:
config['session_reset']['at_hour'] = hour_val
except ValueError:
pass
print_success(f"Sessions reset daily at {config['session_reset'].get('at_hour', 4)}:00")
elif reset_idx == 3: # None
config['session_reset']['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.")
# else: keep current (idx == 4)
# =========================================================================
# Step 7: Messaging Platforms (Optional)
# =========================================================================