|
9 | 9 | from . import doctor as doctor_mod |
10 | 10 | from . import model_inventory |
11 | 11 | from . import roster as roster_mod |
| 12 | +from . import seat_health |
12 | 13 | from . import templates |
13 | 14 | from . import toml_compat |
14 | 15 |
|
@@ -323,6 +324,7 @@ def doctor( |
323 | 324 | *, |
324 | 325 | roster_path: Path | None = None, |
325 | 326 | probe: roster_mod.CapabilityProbe | None = None, |
| 327 | + health_probe: seat_health.SeatHealthProbe | None = None, |
326 | 328 | ) -> int: |
327 | 329 | target = target.expanduser() |
328 | 330 |
|
@@ -356,6 +358,20 @@ def doctor( |
356 | 358 | else: |
357 | 359 | checks.append((doctor_mod.WARN, "roster: allow_models", "not set; explicit model allow-list recommended")) |
358 | 360 |
|
| 361 | + # Use the common coordinator for the health summary, but leave legacy |
| 362 | + # capability and per-model labels below intact for one compatibility |
| 363 | + # release. Doctor never sends model smoke prompts. |
| 364 | + shared_health = (health_probe or seat_health.SeatHealthProbe(collect_executable_version=False)).probe_roster( |
| 365 | + loaded, workspace=target, allow_model_smoke=False |
| 366 | + ) |
| 367 | + for result in shared_health: |
| 368 | + status = doctor_mod.OK if result.status == "healthy" else doctor_mod.WARN |
| 369 | + detail = ( |
| 370 | + "; ".join(f"{check.name}={check.status}" for check in result.checks if check.status != "passed") |
| 371 | + or "all applicable checks passed" |
| 372 | + ) |
| 373 | + checks.append((status, f"agent: {result.seat} health", detail)) |
| 374 | + |
359 | 375 | for name, agent in loaded.agents.items(): |
360 | 376 | if agent.stats is not None or name in local_stats: |
361 | 377 | checks.append((doctor_mod.INFO, f"roster: stats {name}", _stats_detail(name, agent, local_stats))) |
|
0 commit comments