Overview
ManyAI Desktop uses a health monitoring system implemented in lib/healthCheck.ts to periodically assess the status of all configured AI providers. The system polls each provider at a configurable interval, collects performance metrics, and uses these results to influence the smart router's provider selection. Degraded providers are automatically downweighted.
Per-Provider Metrics
| Metric | Description |
|---|---|
uptime_pct | Percentage of recent health checks that succeeded |
avg_latency_ms | Rolling average response time in milliseconds |
last_check_ts | ISO 8601 timestamp of the most recent check |
last_result | "success" or an error string from the last check |
getPenalty(provider)
Returns a 0–1 float for use in the smart router scoring formula:
- 0 = provider is fully healthy, no penalty
- 1 = provider is fully degraded, maximum penalty
score = successRate(last 20) × 0.7 + speedScore × 0.3 − getPenalty(provider)
Configuration
Stored in localStorage under key manyai_health_config.
| Field | Type | Default | Description |
|---|---|---|---|
intervalMinutes | number | 5 | Interval between automatic checks |
continuousEnabled | boolean | false | Whether to poll automatically on a schedule |
Startup Behavior
- If
continuousEnabledis true: performs an immediate health check on app launch, then schedules recurring checks atintervalMinutes. - If
continuousEnabledis false: no automatic checks; manual check available via Settings → Health tab.
UI
Settings → Health tab displays a live status table showing: provider name, uptime %, average latency (ms), last check timestamp, and last result for all configured providers.