mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 04:23:15 -05:00
upgradeTransition ended in panic for a phase or event it did not know. The phase of a submitted operation is read from the journal on disk, so a corrupted file would crash a background goroutine. The reducer now returns errInvalidUpgradeTransition, and submit marks the operation as failed and returns ErrOperationFailed. The current call paths only pass known phases, so this is a guard, not a fix of a known crash. upgradeViews also grew without bound, and every persist walked it. Views of finished upgrades are now kept for the newest 256 only; the journal still answers for older ones. The journal itself is rewritten on each persist, so the walk stays proportional to what is written anyway. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>