Skip to content

fix(preserve-model): parse exported variables in parse_dotenv in preserve-active-model.py - #5562

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/preserve-active-model-export-prefix
Open

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/preserve-active-model-export-prefix

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/scripts/preserve-active-model.py, parse_dotenv() parsed key-value lines without stripping the export keyword. Any environment variables written as export KEY=VALUE were rejected by identifier regex and dropped, causing active model contracts to be lost during upgrades.

Strip leading export prefixes before key-value splitting, aligning dotenv ingestion with validate-env.sh and shell standards.

Validation

  • Baseline reproduction: parse_dotenv() on .env with export GGUF_FILE=... returned an empty dictionary.
  • Post-fix: test_preserve_active_model_export_prefix.py verifies export-prefixed configuration keys parse accurately.
  • Model preservation suites: 1 passed. Ruff and diff checks pass; regression wired into Linux CI.

Overlap check

Searched live open/closed PRs by preserve-active-model.py. #5368 handles GGUF unsampled metadata; this hardens upgrade contract preservation.

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens upgrade dotenv parsing. Independent review remains a gate.

Follow-up integration evidence

Composed with #5368 at 3c186f3 without conflicts. Active model preservation workflows 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.

@vaibhavsrv
vaibhavsrv force-pushed the fix/preserve-active-model-export-prefix branch from 2a63df2 to 0ebcda0 Compare September 17, 2026 04:47
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.

1 participant