hermes-agent/tests/hermes_cli
teknium1 245d174359 feat: validate /model against live API instead of hardcoded lists
Replace the static catalog-based model validation with a live API probe.
The /model command now hits the provider's /models endpoint to check if
the requested model actually exists:

- Model found in API → accepted + saved to config
- Model NOT found in API → rejected with 'Error: not a valid model'
  and fuzzy-match suggestions from the live model list
- API unreachable → graceful fallback to hardcoded catalog (session-only
  for unrecognized models)
- Format errors (empty, spaces, missing '/') still caught instantly
  without a network call

The API probe takes ~0.2s for OpenRouter (346 models) and works with any
OpenAI-compatible endpoint (Ollama, vLLM, custom, etc.).

32 tests covering all paths: format checks, API found, API not found,
API unreachable fallback, CLI integration.
2026-03-08 05:22:20 -07:00
..
__init__.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03:00
test_commands.py test: expand slash command autocomplete coverage (PR #645 follow-up) 2026-03-08 03:53:22 -07:00
test_config.py test: reorganize test structure and add missing unit tests 2026-02-26 03:20:08 +03: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 feat: validate /model against live API instead of hardcoded lists 2026-03-08 05:22:20 -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_set_config_value.py test: add 26 tests for set_config_value secret routing 2026-03-06 04:26:18 -08:00