hermes-agent/tests/cli
Teknium 77bdad5b02
fix(tests): resolve 12 CI failures + 10 errors across 6 root causes (#11040)
Group A (3 tests): 'No LLM provider configured' RuntimeError
- test_user_message_surrogates_sanitized, test_counters_initialized_in_init,
  test_openai_prompt_tokens_unchanged
- Root cause: AIAgent.__init__ now requires base_url alongside api_key to
  skip resolve_provider_client() (which returns None when API keys are
  blanked in CI). Added base_url='http://localhost:1234/v1' to test
  agent construction.

Group B (5 tests): Discord slash command auto-registration
- test_auto_registers_missing_gateway_commands, test_auto_registered_command_*,
  test_register_skill_group_*
- Root cause: xdist workers that loaded a discord mock WITHOUT
  app_commands.Command/Group caused _register_slash_commands() to fail
  silently. Added comprehensive shared discord mock in
  tests/gateway/conftest.py (same pattern as existing telegram mock).

Group C (5 errors): Discord reply mode 'NoneType has no DMChannel'
- All TestReplyToText tests
- Root cause: FakeDMChannel was not a subclass of real discord.DMChannel,
  so isinstance() checks in _handle_message failed when running in full
  suite (real discord installed). Made FakeDMChannel inherit from
  discord.DMChannel when available. Removed fragile monkeypatch approach.

Group D (2 tests): detect_provider_for_model wrong provider
- test_openrouter_slug_match (got 'ai-gateway'), test_bare_name_gets_
  openrouter_slug (got 'copilot')
- Root cause: ai-gateway, copilot, and kilocode are multi-vendor
  aggregators that list other providers' models (OpenRouter-style slugs).
  They were being matched in Step 1 before OpenRouter. Added all three
  to _AGGREGATORS set so they're skipped like nous/openrouter.

Group E (1 test): model_flow_custom StopIteration
- test_model_flow_custom_saves_verified_v1_base_url
- Root cause: 'Display name' prompt was added after the test was written.
  The input iterator had 5 answers but the flow now asks 6 questions.
  Added 6th empty string answer.

Group F (1 test): Telegram proxy env assertion
- test_uses_proxy_env_for_primary_and_fallback_transports
- Root cause: _resolve_proxy_url() now checks TELEGRAM_PROXY first
  (via resolve_proxy_url('TELEGRAM_PROXY')). Test didn't clear this
  env var, allowing potential leakage from other tests in xdist workers.
  Added TELEGRAM_PROXY to the cleanup list.
2026-04-16 06:49:36 -07:00
..
__init__.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_branch_command.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_approval_ui.py fix: handle empty sudo password and false prompts 2026-04-09 02:50:07 -07:00
test_cli_background_tui_refresh.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_browser_connect.py fix: /browser connect auto-launch uses dedicated profile dir (#6821) 2026-04-09 14:55:45 -07:00
test_cli_context_warning.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_extension_hooks.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_file_drop.py fix(termux): add local image chat route 2026-04-09 16:24:53 -07:00
test_cli_image_command.py fix(termux): harden execute_code and mobile browser/audio UX 2026-04-09 16:24:53 -07:00
test_cli_init.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_interrupt_subagent.py fix: resolve CI test failures — add missing functions, fix stale tests (#9483) 2026-04-14 01:43:45 -07:00
test_cli_loading_indicator.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_mcp_config_watch.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_new_session.py fix(tests): resolve remaining CI failures — commit_memory_session, already_sent, timezone leak, session env (#10785) 2026-04-16 02:26:14 -07:00
test_cli_plan_command.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_prefix_matching.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_preloaded_skills.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_provider_resolution.py fix(tests): resolve 12 CI failures + 10 errors across 6 root causes (#11040) 2026-04-16 06:49:36 -07:00
test_cli_retry.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_save_config_value.py fix: remove legacy compression.summary_* config and env var fallbacks (#8992) 2026-04-13 04:59:26 -07:00
test_cli_secret_capture.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_cli_skin_integration.py fix(termux): deepen browser, voice, and tui support 2026-04-09 16:24:53 -07:00
test_cli_status_bar.py fix(termux): tighten voice setup and mobile chat UX 2026-04-09 16:24:53 -07:00
test_cli_status_command.py fix(profile): use existing get_active_profile_name() for /profile command 2026-04-15 17:52:03 -07:00
test_cli_tools_command.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_compress_focus.py feat: /compress <focus> — guided compression with focus topic (#8017) 2026-04-11 19:23:29 -07:00
test_cwd_env_respect.py fix: enforce config.yaml as sole CWD source + deprecate .env CWD vars + add hermes memory reset (#11029) 2026-04-16 06:48:33 -07:00
test_fast_command.py fix(anthropic): send fast mode speed via extra_body 2026-04-13 22:32:39 -07:00
test_manual_compress.py fix(gateway): make manual compression feedback truthful 2026-04-10 21:16:53 -07:00
test_personality_none.py fix(gateway): use profile-aware Hermes paths in runtime hints 2026-04-15 17:52:03 -07:00
test_quick_commands.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00
test_reasoning_command.py fix: clean up stale test references to removed attributes 2026-04-10 03:44:43 -07:00
test_resume_display.py fix: show full last assistant response when resuming a session (#8724) 2026-04-12 19:07:14 -07:00
test_session_boundary_hooks.py fix: add gateway coverage for session boundary hooks, move test to tests/cli/ 2026-04-08 04:27:34 -07:00
test_stream_delta_think_tag.py fix(streaming): prevent <think> in prose from suppressing response output 2026-04-09 22:16:36 -07:00
test_surrogate_sanitization.py fix(tests): resolve 12 CI failures + 10 errors across 6 root causes (#11040) 2026-04-16 06:49:36 -07:00
test_tool_progress_scrollback.py fix(cli): restore stacked tool progress scrollback in TUI (#8201) 2026-04-11 23:22:34 -07:00
test_worktree.py fix: aggressive worktree and branch cleanup to prevent accumulation (#6134) 2026-04-08 04:44:49 -07:00
test_worktree_security.py refactor(tests): re-architect tests + fix CI failures (#5946) 2026-04-07 17:19:07 -07:00