Skip to content

E3AARCHAI-23919: Fix ModelCache crashes on construction in environments without a resolvable home directory#67

Merged
Prithvi686 merged 1 commit into
mainfrom
feature/E3AARCHAI-23919_fix_modelcache_lazy_init
Jul 21, 2026
Merged

E3AARCHAI-23919: Fix ModelCache crashes on construction in environments without a resolvable home directory#67
Prithvi686 merged 1 commit into
mainfrom
feature/E3AARCHAI-23919_fix_modelcache_lazy_init

Conversation

@Prithvi686

Copy link
Copy Markdown
Collaborator

mps-cli-py: Deferred ModelCache directory resolution to first use. Basically constructing ModelCache() or SSolutionsRepositoryBuilder() previously called Path.home() eagerly in init, crashing with RuntimeError in environments where the home directory cannot be resolved (HOME/USERPROFILE unset).

The fix is to store None in init and resolve via _get_dir() lazily on the first actual load() or save() call.

Also, added a new test test_model_cache.py to verify the same.

Basically constructing ModelCache() or SSolutionsRepositoryBuilder() previously called Path.home() eagerly in __init__ so that crashes with RuntimeError in
environments where the home directory cannot be resolved (HOME/USERPROFILE unset) and the fix is to store None in __init__ and resolve via _get_dir() lazily on the
first actual load() or save() call.
@Prithvi686
Prithvi686 requested a review from danielratiu July 21, 2026 10:15
@Prithvi686
Prithvi686 merged commit 041f825 into main Jul 21, 2026
4 checks passed
@Prithvi686
Prithvi686 deleted the feature/E3AARCHAI-23919_fix_modelcache_lazy_init branch July 21, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants