Files
LocalAI/core/services
Ettore Di Giacinto 6a7a2db672 fix(addons): do not panic on an unknown upgrade phase
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>
2026-11-03 08:45:52 +00:00
..
2026-03-30 00:47:27 +02:00