Skip to content

feat(doctor): #7 一键诊断修复 fixAction 框架 (warning 携带可调用 auto-fix) #130

Closed

Description

@dahai80

背景

enhance-0819.md #7: 一键诊断+修复。/doctor 的 warnings 当前仅含 fix: string (人类可读指令, 不可调用)。无 fixAction 字段 → 无确定性的可执行 auto-fix。

缺口 (surgical)

doctorDiagnostic.ts:69 类型 warnings: Array<{ issue: string; fix: string }> — fix 是指令字符串, 永不被调用。无 fixAction 字段。

方案

  • 扩展类型加 fixAction?: () => Promise<unknown> (返回结果透传给消费者)
  • 在确定性可自动修复的 warning 上 attach fixAction。首个落地 = MLX OOM (high/imminent): fixAction: requestMlxGC (POST /api/v1/gc, 同 adapter 已有, item 15 已验证安全)
  • env-conflict / MLX-start / model-load 非进程内确定性修复 (需 shell 重启 / 跨 CLI), 保留人类可读 fix 字符串, 不 attach fixAction (Rule 2 最小)
  • Doctor.tsx UI 交互 (按 f 触发) 涉及 React-compiler-optimized state ($[N] memo slots), 脆弱 → 独立 defer。本 PR 落框架 + 数据层可调用, UI 消费后续

关联

enhance-0819.md #7 (§684)

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