Repository navigation
fix(model-stores): guard missing env and strip export prefix in compose flag resolver - #5874
Closed
vaibhavsrv wants to merge 1 commit into
Closed
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
This was referenced Sep 19, 2026
Closed
Collaborator
|
Thanks for this contribution. |
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.
Why this matters
In
ods/scripts/model-store-compose-flags.py,resolve_flags()attempts to readroot / '.env'directly to discover the active model store identifier via(root / '.env').read_text(encoding='utf-8'). When invoked on clean checkouts, during preflight checks, or in decoupled environments where model stores are registered but.envhas not yet been generated, this throws an unhandledFileNotFoundError(exit code 2). Furthermore, key matching checkedkey.strip() == 'ODS_ACTIVE_MODEL_STORE', which fails to recognize lines defined with the standard shellexportprefix (e.g.export ODS_ACTIVE_MODEL_STORE="fast-ssd"), causing the script to fall back to the default overlay and fail to mount the active model store.This patch adds a guard ensuring
(root / '.env').is_file()before reading, uses safe replacement decoding on read, and normalizes candidate keys by stripping leadingexportprefixes. Missing.envfiles safely default to the'default'identifier without aborting execution.Validation
.envthrewFileNotFoundErrorand returned exit code 2; verified thatexport ODS_ACTIVE_MODEL_STORE=ssdfailed to attachdata/.active-model-store.compose.json..envsafely defaults to'default'and mounts.model-stores.compose.json, whileexport ODS_ACTIVE_MODEL_STORE="ssd"resolves and attachesdata/.active-model-store.compose.json.test_model_store_compose_flags_env.pywired into Linux CI.Overlap check
.envdiscovery orexportprefix parsing inmodel-store-compose-flags.py. Existing overlay validation, path deduplication, and Windows PowerShell bridge behavior remain untouched.Risk / AI disclosure
AI-assisted investigation, implementation and CLI regressions. This strengthens Compose overlay resolution for external model stores; runtime daemon behavior, docker execution, and catalog models are not altered. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #5870 at
680c2437b8e64987d88ca65bffc8c7df469d6d2cwithout conflicts. Production and test diffs passed together; adjacent compose flags and model-store tests remain intact.Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.