feat(desktop/account-health): treat active/expiring_soon probes as live and dedupe in-flight checks

Why: avoid showing accounts as not-live during stale-window probes; keep publish gating consistent with runtime view.

- collapse FIRST_PROBE window so initial probe runs immediately
- skip due-probe selection when a probe is already queued/in-flight
- mirror auth-state→health projection on both client report and tenant ingest paths

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-29 15:58:25 +08:00
parent f8b918b9cd
commit 59ad14ef2c
6 changed files with 148 additions and 48 deletions
@@ -1,6 +1,12 @@
import type { DesktopAccountInfo } from "@geo/shared-types";
export function resolveAccountHealth(account: DesktopAccountInfo): DesktopAccountInfo["health"] {
if (
account.runtime_auth_state === "active" ||
(account.runtime_auth_state === "expiring_soon" && account.runtime_probe_state !== "network_error")
) {
return "live";
}
return account.runtime_health ?? account.health;
}