mirror of
https://github.com/mudler/LocalAI.git
synced 2026-07-08 07:18:31 -04:00
InstallBackend extracted the artifact directly into the target directory with no pre-clean, so a reinstall overlaid the new files onto the old ones. Files present in a previous version but absent in the new artifact (a stale .so, an orphaned package dir) survived and could shadow the new build at import time -- e.g. an old vllm shared object lingering next to a freshly pulled one. Only a failed download cleaned the directory. Stage the download/extraction into a `<name>.install-tmp` dir, validate run.sh is present, write metadata, then atomically swap it into place (rename current -> .install-backup, staging -> current, drop backup), rolling back on failure. This mirrors the atomic swap UpgradeBackend already performs, so install and upgrade now leave identical on-disk state with no orphaned files. Reported as part of #10720. Assisted-by: Claude:claude-opus-4-8 [Claude Code] Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Co-authored-by: Ettore Di Giacinto <mudler@localai.io>