diff --git a/tests/test_issue1699_model_cache_source_fingerprint.py b/tests/test_issue1699_model_cache_source_fingerprint.py index 0a06d3b8..c5a84cdd 100644 --- a/tests/test_issue1699_model_cache_source_fingerprint.py +++ b/tests/test_issue1699_model_cache_source_fingerprint.py @@ -141,7 +141,9 @@ def test_disk_models_cache_still_loads_when_auth_and_config_sources_are_unchange result = config.get_available_models() - assert result == fresh_opencode + # The disk-cache hit reconstructs `aliases` from current config (the save + # path doesn't persist aliases); no config aliases here, so it's {}. + assert result == {**fresh_opencode, "aliases": {}} def test_memory_models_cache_invalidates_when_static_catalog_changes(tmp_path, monkeypatch): diff --git a/tests/test_model_cache_metadata.py b/tests/test_model_cache_metadata.py index 271cf9d4..8881d51c 100644 --- a/tests/test_model_cache_metadata.py +++ b/tests/test_model_cache_metadata.py @@ -46,9 +46,12 @@ def test_save_models_cache_to_disk_preserves_response_metadata(tmp_path, monkeyp if "api.updates" in sys.modules: assert on_disk.get("_webui_version") == sys.modules["api.updates"].WEBUI_VERSION - # Load returns ONLY the response-shape fields (stamps stripped). + # Load returns the response-shape fields (stamps stripped) plus `aliases`, + # which the loader reconstructs from current config because the save path + # does not persist aliases on disk (keeps /model resolution working + # on a disk-cache hit). No config aliases here, so it reconstructs to {}. loaded = config._load_models_cache_from_disk() - assert loaded == payload + assert loaded == {**payload, "aliases": {}} def test_load_models_cache_from_disk_rejects_legacy_groups_only_cache(tmp_path, monkeypatch):