fix(model): refresh cached model catalogs - #24019
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
helix4u
marked this pull request as ready for review
May 11, 2026 21:32
Contributor
Review: Solid cache invalidation fix with good UXThe Implementation quality
Non-blocking notes
|
Contributor
|
main now reseeds stale catalogs on update ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes stale hosted model catalogs after
hermes updateand adds an explicithermes model --refreshrecovery path.The remote model catalog is cached under the resolved Hermes home, but update previously refreshed the repo without invalidating that user-local cache. Users could update Hermes and still see an old OpenRouter/Nous curated model list until the 24 hour TTL expired. This change makes update semantics match user expectation: after update, the next model picker sees fresh remote catalog data or falls back to the newly bundled snapshot.
The implementation uses Hermes path resolvers instead of hardcoded Windows or Unix home paths, so AppData installs, custom
HERMES_HOME, Docker, and profile homes follow the same runtime lookup.Related Issue
N/A
Type of Change
Changes Made
hermes_cli/main.py: addhermes model --refresh, clear the model catalog cache before opening the picker, and invalidate model catalog caches duringhermes update, including already-up-to-date and ZIP update paths.hermes_cli/model_catalog.py: add force-refresh plumbing for provider accessors, clear both in-process and disk cache through the resolved Hermes home, and avoid reusing stale disk cache on explicit refresh failure.hermes_cli/models.py: threadforce_refreshinto OpenRouter and Nous hosted catalog lookups.tests/hermes_cli/test_model_catalog.py: cover stale-cache fallback, force-refresh behavior, resolved-home cache deletion, and provider accessor refresh propagation.tests/hermes_cli/test_models.py: cover OpenRouter and Nous force-refresh propagation into hosted catalog lookups.tests/hermes_cli/test_update_check.py: cover update invalidation of model catalog caches across default and profile homes.How to Test
python -m pytest -n 0 tests/hermes_cli/test_model_catalog.py tests/hermes_cli/test_models.py tests/hermes_cli/test_update_check.py -q.python -m py_compile hermes_cli/main.py hermes_cli/model_catalog.py hermes_cli/models.py.python -m hermes_cli.main model --helpand confirm--refreshis listed.scripts/run_tests.shfor the full non-integration suite.Checklist
Code
fix(scope):,feat(scope):, etc.)cache/model_catalog.json.pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
Targeted validation before opening the draft:
python -m pytest -n 0 tests/hermes_cli/test_model_catalog.py tests/hermes_cli/test_models.py tests/hermes_cli/test_update_check.py -q94 passed in 3.21spython -m py_compile hermes_cli/main.py hermes_cli/model_catalog.py hermes_cli/models.pypython -m hermes_cli.main model --help--refreshis listedFull-suite validation after opening the draft:
scripts/run_tests.sh63 failed, 22124 passed, 59 skipped, 236 warnings, 19 errors in 622.55s (0:10:22).4workers.HERMES_HOMEwas empty before the run and empty after the run.ruamel, missingpsutil, Dingtalk async mock comparison failures, browser supervisor runtime errors, and process-timeout/zombie cleanup tests. The targeted tests for this PR passed.