Update backend status handling and improve user notifications

- Enhanced documentation to clarify the transition from 'Idle' to 'ready (running)' for backend states, improving user understanding of system readiness.
- Updated logging messages in the notification system to reflect the new backend status terminology, ensuring accurate feedback during operations.
- Refined access link collection logic to better handle tunneled and non-tunneled scenarios, enhancing user experience.
- Improved tests to validate the new backend status handling and ensure accurate reporting of access links and notifications.
This commit is contained in:
Leonid Pershin
2026-08-21 09:53:48 +03:00
parent 281ae15b12
commit 3e0a51cac4
11 changed files with 173 additions and 116 deletions
+7 -1
View File
@@ -99,10 +99,16 @@ def swarm_busy(swarm_url: str, timeout: float = 8.0) -> tuple[bool, str]:
live = int(status.get("live_gens") or 0)
loading = int(status.get("loading_models") or 0)
bstat = str(backend.get("status") or "unknown").lower()
any_loading = bool(backend.get("any_loading"))
if waiting or live or loading:
return True, f"queue waiting={waiting} live={live} loading={loading}"
if bstat not in {"idle", "disabled", "all_disabled", "empty"}:
# SwarmUI "running" = healthy ready (no gens) — not busy for billing.
# "loading" / "some_loading" = still starting — keep GPU.
if bstat in {"loading", "some_loading"} or any_loading:
return True, f"backend={bstat}"
if bstat == "errored":
return True, f"backend={bstat}"
# running / idle / disabled / empty / unknown with empty queue → allow idle clock
return False, f"idle backend={bstat}"