Skip to content

/doctor 接入 MLX /v1/health 内存/OOM 诊断 (P4.2 #4; fusion-mlx#564 落地下游) #124

Closed

Description

@dahai80

背景

fusion-mlx#564 已落地 (PR #581 MERGED): `GET /v1/health` 只读内存/OOM 状态端点 (management-gated, #344 parity)。返回:

  • `status` (ok|degraded|oom), `version`, `uptime_seconds`, `active_models`
  • `memory` {rss_bytes/used_bytes/free_bytes/total_bytes + mlx_active/cache/peak_bytes + per_model [{name,bytes}]}
  • `oom_risk` (none|low|high|imminent) — 确定性双信号分类器 (available_ratio + mlx_peak_ratio)

#564 body 明示下游: `fusion-code 侧补 fetchMlxHealth() 接入 detectMlxHealth() + OOM 恢复逻辑`。

现况

落地 (本 issue, surgical)

  1. 扩 `MLXHealthResponse` 类型: status 加 'degraded'|'oom', 新增 `memory` + `oom_risk` (匹配 PR #581 shape)。
  2. `model-status.ts` 新 `fetchMlxHealth()`: GET /v1/health, 复用 adapter `getMlxAuthHeaders()` (dynamic import) 带 Bearer, 3s timeout。401/网络/超时 → null (fail-open, MLX 未配 key 则 management 端点 401 fix(api): env-tunable 529 retry budget #350 loopback 不豁免 → 跳过 OOM 检测, 不误报)。
  3. `detectMlxHealth()` 有模型 loaded 时查 health: oom_risk high → degraded warning, imminent → oom warning。fail-open null → 跳过。
  4. 测试 + gate。

item 15 (OOM 自动恢复 / 网关重连续) = L-size follow-up, 本 issue 仅 #4 /doctor 主动 OOM 检测。

跨仓

fusion-mlx#564 (CLOSED, PR #581)。本 issue 为 fusion-code 侧下游接入。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions