Skip to content

fix(config): ignore yaml backup files in model loader#9443

Merged
mudler merged 1 commit into
mudler:masterfrom
leinasi2014:codex/fix-model-config-loader-yaml-suffix
Apr 20, 2026
Merged

fix(config): ignore yaml backup files in model loader#9443
mudler merged 1 commit into
mudler:masterfrom
leinasi2014:codex/fix-model-config-loader-yaml-suffix

Conversation

@leinasi2014

@leinasi2014 leinasi2014 commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes #9442.

It tightens LoadModelConfigsFromPath() so only files whose actual extension is .yaml or .yml are loaded as model configs. Backup files such as model.yaml.bak and model.yaml.bak.<timestamp> are now ignored.

It also adds a regression test covering:

  • loading a normal .yaml config
  • ignoring .yaml.bak
  • ignoring .yaml.bak.<timestamp>
  • preventing backup configs from overriding the active config

Notes for Reviewers

  • Reproduced in a live distributed deployment where stale *.yaml.bak* files in /models overrode the active config with the same name:.
  • Verified locally in Docker with:
    • make protogen-go
    • copying tests/models_fixtures/* into test-models
    • go test ./core/config

Signed commits

  • Yes, I signed my commits.
Only load files whose real extension is .yaml or .yml so backup files like model.yaml.bak do not override active configs. Add a regression test covering plain and timestamped backup files.

Assisted-by: Codex:gpt-5.4 docker
Signed-off-by: leinasi2014 <leinasi2014@gmail.com>
@leinasi2014 leinasi2014 force-pushed the codex/fix-model-config-loader-yaml-suffix branch from e0dc41d to 5959572 Compare April 20, 2026 11:09
@mudler mudler merged commit 486b5e2 into mudler:master Apr 20, 2026
38 checks passed
@localai-bot localai-bot added the bug Something isn't working label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

3 participants