## 背景 enhance-0819.md §P4.2 (lines 666-675) 定 7 项 /doctor 本地健康检查。审计结论: - ✅ #5 CLAUDE.md 裁剪 — 已覆盖 (`checkClaudeMdFiles`) - ✅ #6 配置冲突 — PR #90 (`detectFusionEnvConflicts`) - ⏳ #7 一键修复 — 远期 - ⏳ #4 OOM/内存 — **跨仓**: MLX `/api/tags`/`/api/ps`/`/v1/models` 仅暴露 model list + loaded names, 无 memory 字段; `MLXHealthResponse` type 定义但 adapter 从未 fetch; 唯一暴露 memory 的是 `POST /api/v1/gc` (mutating, 不适合只读诊断). 真 OOM status 需 fusion-mlx 加端点 → 单独 issue - **真 gap = #1 MLX 端口/网关连通 + #3 模型加载状态** — `/doctor` 当前完全不探测 MLX (`doctorDiagnostic.ts` grep mlx/11432 = 0 命中) ## 方案 复用 `model-status.ts` 的 `fetchMlxStatus`/`fetchMlxPs` (已 export, `/api/tags`+`/api/ps`, 3s timeout)。新增 `detectMlxHealth()` async fn in `doctorDiagnostic.ts`, 在 `getDoctorDiagnostic()` 内 push 进 `warnings`。仅当 `shouldAutoUseFusionMlx()` (MLX 配置 provider) 时探测 — cloud-active 跳过避免 3s 浪费 + 噪音。 不改 `Doctor.tsx` — `diagnostic.warnings` 已数据驱动渲染。 ## 范围 - 1 prod file: `src/utils/doctorDiagnostic.ts` (+detectMlxHealth, 2 import, 接入) - 1 test file: `src/__tests__/utils/doctorMlxHealth.test.ts` (mock fetchMlxStatus/fetchMlxPs + providers env) - 不含 #4 OOM (跨仓延后), #7 (远期) ## 验证 typecheck 0, 单测覆盖 4 case (cloud-skip / not-reachable / no-model-loaded / healthy), 全测无回归, build + dev:full pass, biome clean, `git diff -w` 零 churn。
Activity