chore: remove ~100 unused imports across 55 files (#3016)

Automated cleanup via pyflakes + autoflake with manual review.

Changes:
- Removed unused stdlib imports (os, sys, json, pathlib.Path, etc.)
- Removed unused typing imports (List, Dict, Any, Optional, Tuple, Set, etc.)
- Removed unused internal imports (hermes_cli.auth, hermes_cli.config, etc.)
- Fixed cli.py: removed 8 shadowed banner imports (imported from hermes_cli.banner
  then immediately redefined locally — only build_welcome_banner is actually used)
- Added noqa comments to imports that appear unused but serve a purpose:
  - Re-exports (gateway/session.py SessionResetPolicy, tools/terminal_tool.py
    is_interrupted/_interrupt_event)
  - SDK presence checks in try/except (daytona, fal_client, discord)
  - Test mock targets (auxiliary_client.py Path, mcp_config.py get_hermes_home)

Zero behavioral changes. Full test suite passes (6162/6162, 2 pre-existing
streaming test failures unrelated to this change).
This commit is contained in:
Teknium 2026-03-25 15:02:03 -07:00 committed by GitHub
parent 861624d4e9
commit 8bb1d15da4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 51 additions and 119 deletions

View file

@ -283,7 +283,6 @@ from hermes_cli.config import (
save_env_value,
get_env_value,
ensure_hermes_home,
DEFAULT_CONFIG,
)
from hermes_cli.colors import Colors, color
@ -798,15 +797,11 @@ def setup_model_provider(config: dict):
"""Configure the inference provider and default model."""
from hermes_cli.auth import (
get_active_provider,
get_provider_auth_state,
PROVIDER_REGISTRY,
format_auth_error,
AuthError,
fetch_nous_models,
resolve_nous_runtime_credentials,
_update_config_for_provider,
_login_openai_codex,
get_codex_auth_status,
resolve_codex_runtime_credentials,
DEFAULT_CODEX_BASE_URL,
detect_external_credentials,
@ -975,7 +970,7 @@ def setup_model_provider(config: dict):
print()
try:
from hermes_cli.auth import _login_nous, ProviderConfig
from hermes_cli.auth import _login_nous
import argparse
mock_args = argparse.Namespace(
@ -3303,7 +3298,6 @@ def _run_quick_setup(config: dict, hermes_home):
get_missing_env_vars,
get_missing_config_fields,
check_config_version,
migrate_config,
)
print()