mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-28 04:30:18 +00:00
a1c5c395e5
## Summary Fixes the ordering-dependent test failure in `test_custom_provider_display_name.py` (issue #754). **Root cause:** `_models_with_cfg()` patches `config.cfg` then calls `get_available_models()`. That function checks `config.yaml`'s mtime on every call — if it has changed since the last `reload_config()`, it calls `reload_config()` again, which reads from disk and silently overwrites the patch. Any test that writes `config.yaml` (e.g. via `save_settings()`) before this test runs changes the mtime and triggers the reload. **Fix:** Pin `config._cfg_mtime` to the current `config.yaml` mtime before calling `get_available_models()`, then restore it in the `finally` block. This is the same pattern already used in `test_model_resolver.py` (lines 249, 393). **Also restores `_cfg_mtime`** in the `finally` block so the patch leaves no side effects on subsequent tests. ## Tests 1510 passed — the previously-flaky test now passes regardless of which tests ran before it. Closes #754