Recover router availability after failed profile switch

This commit is contained in:
Mikei386
2026-09-02 22:03:35 +02:00
parent b3e86cc7ae
commit 4153e535d3
2 changed files with 17 additions and 0 deletions
+5
View File
@@ -698,6 +698,11 @@ def switch_profile(profile: str, implicit: bool = False) -> None:
up = upstream_status()
ready = _profile_is_ready(profile, up)
if cur == profile and ready:
# A previous failed switch can leave the in-memory availability
# flag set even though the controller and llama.cpp have since
# recovered. The semantic readiness check above is authoritative,
# so clear the stale flag before returning.
_set_qwen_unavailable(False)
log.info("Profil %s ist bereits aktiv", profile)
return
# Qwen wird neu geladen/gewechselt → für Chats nicht verfügbar.