hermes-agent/tests/hermes_cli
Teknium 3eade90b39
fix: OpenClaw migration now shows dry-run preview before executing (#6769)
The setup wizard's OpenClaw migration previously ran immediately with
aggressive defaults (overwrite=True, preset=full) after a single
'Would you like to import?' prompt. This caused several problems:

- Config values with different semantics (e.g. tool_call_execution:
  'auto' in OpenClaw vs 'off' for Hermes yolo mode) were imported
  without translation
- Gateway tokens were hijacked from OpenClaw without warning, taking
  over Telegram/Slack/Discord channels
- Instruction files (.md) containing OpenClaw-specific setup/restart
  procedures were copied, causing Hermes restart failures

Now the migration:
1. Asks 'Would you like to see what can be imported?' (softer framing)
2. Runs a dry-run preview showing everything that would be imported
3. Displays categorized warnings for high-impact items (gateway
   takeover, config value differences, instruction files)
4. Asks for explicit confirmation with default=No
5. Executes with overwrite=False (preserves existing Hermes config)

Also extracts _load_openclaw_migration_module() for reuse and adds
_print_migration_preview() with keyword-based warning detection.

Tests updated for two-phase behavior + new test for decline-after-preview.
2026-04-09 12:15:06 -07:00
..
__init__.py
test_anthropic_oauth_flow.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_anthropic_provider_persistence.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_api_key_providers.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_argparse_flag_propagation.py fix: --yolo and other flags silently dropped when placed before 'chat' subcommand (#5145) 2026-04-04 16:55:13 -07:00
test_atomic_json_write.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_atomic_yaml_write.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_auth_codex_provider.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_auth_commands.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_auth_nous_provider.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_auth_qwen_provider.py feat(qwen): add Qwen OAuth provider with portal request support 2026-04-08 13:46:30 -07:00
test_banner_git_state.py fix: CLI/UX batch — ChatConsole errors, curses scroll, skin-aware banner, git state banner (#5974) 2026-04-07 17:59:42 -07:00
test_banner_skills.py
test_banner.py
test_chat_skills_flag.py
test_claw.py feat: add post-migration cleanup for OpenClaw directories (#4100) 2026-03-30 17:39:08 -07:00
test_cmd_update.py
test_coalesce_session_args.py
test_codex_models.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_commands.py fix: remove /prompt slash command — footgun via prefix expansion (#6752) 2026-04-09 11:27:27 -07:00
test_config_env_expansion.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_config_validation.py feat: config structure validation — detect malformed YAML at startup (#5426) 2026-04-05 23:31:20 -07:00
test_config.py fix: hermes auth remove now clears env-seeded credentials permanently (#5285) 2026-04-05 12:00:53 -07:00
test_copilot_auth.py
test_cron.py
test_doctor.py fix(doctor): only check the active memory provider, not all providers unconditionally (#6285) 2026-04-08 13:44:58 -07:00
test_env_loader.py
test_external_credential_detection.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_gateway_linger.py fix(cli): add missing subprocess.run() timeouts in gateway CLI (#5424) 2026-04-05 22:41:42 -07:00
test_gateway_runtime_health.py
test_gateway_service.py fix: add _profile_arg tests + move STT language to config.yaml 2026-04-07 17:59:16 -07:00
test_gateway.py fix(cli): add missing subprocess.run() timeouts in gateway CLI (#5424) 2026-04-05 22:41:42 -07:00
test_gemini_provider.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_launcher.py
test_logs.py feat: centralized logging, instrumentation, hermes logs CLI, gateway noise fix (#5430) 2026-04-06 00:08:20 -07:00
test_managed_installs.py chore: prepare Hermes for Homebrew packaging (#4099) 2026-03-30 17:34:43 -07:00
test_mcp_config.py
test_mcp_tools_config.py
test_model_normalize.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_model_provider_persistence.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_model_switch_variant_tags.py fix(models): preserve OpenRouter variant tags (:free, :extended, :fast) during model switch (#6383) 2026-04-08 19:58:16 -07:00
test_model_validation.py fix: repair OpenCode model routing and selection (#4508) 2026-04-02 09:36:24 -07:00
test_models.py fix(nous): add 3-minute TTL cache to free-tier detection 2026-04-07 09:30:26 -07:00
test_nous_subscription.py feat: switch managed browser provider from Browserbase to Browser Use (#5750) 2026-04-07 08:40:22 -04:00
test_ollama_cloud_auth.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_path_completion.py
test_placeholder_usage.py
test_plugin_cli_registration.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_plugins_cmd.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_plugins.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_profile_export_credentials.py fix: also exclude .env from default profile exports 2026-04-01 11:20:33 -07:00
test_profiles.py fix: also exclude .env from default profile exports 2026-04-01 11:20:33 -07:00
test_runtime_provider_resolution.py feat(qwen): add Qwen OAuth provider with portal request support 2026-04-08 13:46:30 -07:00
test_session_browse.py
test_sessions_delete.py
test_set_config_value.py fix(cli): allow empty strings and falsy values in config set 2026-03-31 11:41:12 -07:00
test_setup_matrix_e2ee.py fix: add missing shutil import for Matrix E2EE setup 2026-04-05 11:07:47 -07:00
test_setup_model_provider.py Merge branch 'main' into rewbs/tool-use-charge-to-subscription 2026-04-02 11:00:35 +11:00
test_setup_model_selection.py fix(minimax): correct context lengths, model catalog, thinking guard, aux model, and config base_url 2026-04-08 02:20:46 -07:00
test_setup_noninteractive.py
test_setup_openclaw_migration.py fix: OpenClaw migration now shows dry-run preview before executing (#6769) 2026-04-09 12:15:06 -07:00
test_setup_prompt_menus.py
test_setup.py Merge branch 'main' into rewbs/tool-use-charge-to-subscription 2026-04-02 11:00:35 +11:00
test_skills_config.py fix: respect per-platform disabled skills in Telegram menu and gateway dispatch (#4799) 2026-04-03 10:10:53 -07:00
test_skills_hub.py
test_skills_install_flags.py
test_skills_skip_confirm.py
test_skills_subparser.py
test_skin_engine.py
test_status_model_provider.py feat: switch managed browser provider from Browserbase to Browser Use (#5750) 2026-04-07 08:40:22 -04:00
test_status.py
test_subprocess_timeouts.py
test_tool_token_estimation.py
test_tools_config.py feat(tools): add "no_mcp" sentinel to exclude MCP servers per platform 2026-04-07 18:00:01 -07:00
test_tools_disable_enable.py
test_update_autostash.py fix: use get_hermes_home(), consolidate git_cmd, update tests 2026-04-03 01:46:42 -07:00
test_update_check.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_update_gateway_restart.py refactor: simplify _get_service_pids — dedupe systemd scopes, fix self-import, harden launchd parsing 2026-04-06 00:09:06 -07:00
test_webhook_cli.py