hermes-agent/tests/hermes_cli
Teknium 4a8cd6f856
fix: stop rejecting unlisted models, accept with warning instead
* fix: use session_key instead of chat_id for adapter interrupt lookups

monitor_for_interrupt() in _run_agent was using source.chat_id to query
the adapter's has_pending_interrupt() and get_pending_message() methods.
But the adapter stores interrupt events under build_session_key(source),
which produces a different string (e.g. 'agent:main:telegram:dm' vs '123456').

This key mismatch meant the interrupt was never detected through the
adapter path, which is the only active interrupt path for all adapter-based
platforms (Telegram, Discord, Slack, etc.). The gateway-level interrupt
path (in dispatch_message) is unreachable because the adapter intercepts
the 2nd message in handle_message() before it reaches dispatch_message().

Result: sending a new message while subagents were running had no effect —
the interrupt was silently lost.

Fix: replace all source.chat_id references in the interrupt-related code
within _run_agent() with the session_key parameter, which matches the
adapter's storage keys.

Also adds regression tests verifying session_key vs chat_id consistency.

* debug: add file-based logging to CLI interrupt path

Temporary instrumentation to diagnose why message-based interrupts
don't seem to work during subagent execution. Logs to
~/.hermes/interrupt_debug.log (immune to redirect_stdout).

Two log points:
1. When Enter handler puts message into _interrupt_queue
2. When chat() reads it and calls agent.interrupt()

This will reveal whether the message reaches the queue and
whether the interrupt is actually fired.

* fix: accept unlisted models with warning instead of rejecting

validate_requested_model() previously hard-rejected any model not found
in the provider's API listing. This was too aggressive — users on higher
plan tiers (e.g. Z.AI Pro/Max) may have access to models not shown in
the public listing (like glm-5 on coding endpoints).

Changes:
- validate_requested_model: accept unlisted models with a warning note
  instead of blocking. The model is saved to config and used immediately.
- Z.AI setup: always offer glm-5 in the model list regardless of whether
  a coding endpoint was detected. Pro/Max plans support it.
- Z.AI setup detection message: softened from 'GLM-5 is not available'
  to 'GLM-5 may still be available depending on your plan tier'
2026-03-12 16:02:35 -07:00
..
__init__.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_claw.py feat: add 'hermes claw migrate' command + migration docs 2026-03-12 08:20:12 -07:00
test_coalesce_session_args.py fix(cli): handle unquoted multi-word session names in -c/--continue and -r/--resume 2026-03-09 21:36:29 -07:00
test_commands.py feat(cli): add /reasoning command for effort level and display toggle 2026-03-11 06:02:18 -07:00
test_config.py fix(config): atomic write for config.yaml to prevent data loss on crash 2026-03-10 06:48:37 -07:00
test_doctor.py fix(doctor): recognize OPENAI_API_KEY custom endpoint config 2026-03-06 19:47:09 -08:00
test_model_validation.py fix: stop rejecting unlisted models, accept with warning instead 2026-03-12 16:02:35 -07:00
test_models.py test: enhance session source tests and add validation for chat types 2026-02-26 00:53:57 -08:00
test_session_browse.py feat: interactive session browser with search filtering (#718) 2026-03-08 17:42:50 -07:00
test_set_config_value.py chore: remove all NOUS_API_KEY references 2026-03-08 17:45:38 -07:00
test_setup.py fix: remove nous-api test + fix OAuth test index after nous-api removal 2026-03-12 00:51:30 -07:00
test_setup_openclaw_migration.py test: verify reloaded config drives setup after migration 2026-03-12 02:56:36 +05:30
test_skills_config.py refactor: extract shared curses checklist, fix skill discovery perf 2026-03-11 03:06:15 -07:00
test_skills_hub.py chore(skills): clean up PR #862 — simplify manifest guard, DRY up tests 2026-03-12 08:08:22 -07:00
test_skills_subparser.py fix(cli): resolve duplicate 'skills' subparser crash on Python 3.11+ 2026-03-11 00:50:39 -07:00
test_skin_engine.py feat: add data-driven skin/theme engine for CLI customization 2026-03-10 00:37:28 -07:00
test_tools_config.py Add tools summary flag to Hermes CLI 2026-03-09 16:50:53 +03:00