Install
openclaw skills install openclaw-iflow-doctorAI-powered auto-repair system for OpenClaw with iflow integration. Automatically diagnose and fix crashes, config errors, model issues. Falls back to iflow-h...
openclaw skills install openclaw-iflow-doctor自动诊断和修复 OpenClaw 崩溃、配置错误、模型问题。当自动修复失败时,无缝调用 iflow-helper 协助。
自动调用链:
OpenClaw 错误 → Self-Healing 尝试修复
├─ 成功 → 记录并恢复
└─ 失败 → 自动调用 iflow-helper → iflow CLI 协助
触发方式:
openclaw heal "错误描述"openclaw skills run openclaw-iflow-doctor --check| 类型 | 自动修复 | 需 iflow 协助 |
|---|---|---|
| memory (记忆损坏) | ✓ 重置索引 | 复杂数据恢复 |
| gateway (网关崩溃) | ✓ 重启服务 | 配置损坏修复 |
| config (配置错误) | ✓ 自动修正 | 手动配置指导 |
| network (网络问题) | ✓ 检查连接 | 代理设置指导 |
| api (API 额度/密钥) | ✗ 额度检查 | 充值/更新密钥 |
| agent (Agent 冲突) | ✓ 重新加载 | 复杂配置调整 |
| permission (权限错误) | ✓ 修复权限 | 系统权限指导 |
| install (安装损坏) | ✗ 备份重装 | 完整重装指导 |
# 方式 1: 从 GitHub 安装
openclaw skills install https://github.com/kosei-echo/openclaw-iflow-doctor
# 方式 2: 本地安装
cd ~/.openclaw/skills/
git clone https://github.com/kosei-echo/openclaw-iflow-doctor.git
openclaw skills enable openclaw-iflow-doctor
# 启用自动模式(推荐)
openclaw skills config openclaw-iflow-doctor --set auto_heal=true
# 启用监控模式
openclaw skills run openclaw-iflow-doctor --watchdog
启用后无需干预,自动处理所有错误:
# 启用自动修复
openclaw skills enable openclaw-iflow-doctor --auto
# 后续所有错误自动处理
# 简单问题自动修复
# 复杂问题生成 BAT 文件并提示调用 iflow
# 诊断特定问题
openclaw heal "Gateway service crashed"
# 或完整命令
openclaw skills run openclaw-iflow-doctor --diagnose "错误描述"
# 启动前检查配置
openclaw skills run openclaw-iflow-doctor --check-config
# 输出示例:
# ✓ Config file exists
# ✓ JSON syntax valid
# ✓ Required fields present
# ✓ Model connectivity OK
openclaw skills run openclaw-iflow-doctor --stats
# 输出:
# Total cases: 10
# Total records: 25
# Auto-fixed: 18
# Iflow-assisted: 7
# Success rate: 92%
[系统] OpenClaw gateway crashed
[系统] Self-Healing triggered
[系统] Analyzing: Gateway crash detected
[系统] Searching case library... Match found: CASE-002
[系统] Applying solution: Restart gateway service
[系统] ✓ Gateway restarted successfully
[系统] Report: openclaw修复报告_20240227.txt
[系统] Record saved to memory
用户操作: 查看报告,无需干预
[系统] OpenClaw config error
[系统] Self-Healing triggered
[系统] Analyzing: Complex config corruption
[系统] Searching case library... No match
[系统] Searching records... No previous fix
[系统] ✗ Cannot auto-fix
[系统] Generated: openclaw诊断书_20240227.txt
[系统] Generated: 重新安装openclaw.bat
[系统] Generated: 打开iFlow寻求帮助.bat
[系统]
[系统] 💡 Suggestion: Double-click BAT files on desktop
[系统] Or run: openclaw skills run iflow-helper
用户操作:
openclaw gateway start
[系统] Config check running...
[系统] ⚠ Missing field: models.default
[系统] Attempting auto-fix...
[系统] ✓ Fixed: Set default model to deepseek-chat
[系统] Starting gateway...
[系统] ✓ Gateway started
位置: ~/.openclaw/skills/openclaw-iflow-doctor/config.json
{
"version": "2.0.0",
"auto_heal": true,
"enable_bat_generation": true,
"enable_iflow_integration": true,
"similarity_threshold": 0.7,
"max_bat_files": 2,
"iflow_helper_skill": "iflow-helper",
"language": "auto"
}
| 配置项 | 默认值 | 说明 |
|---|---|---|
| auto_heal | true | 是否自动尝试修复 |
| enable_bat_generation | true | 无法修复时是否生成 BAT |
| enable_iflow_integration | true | 是否启用 iflow-helper 调用 |
| similarity_threshold | 0.7 | 案例匹配相似度阈值 |
| max_bat_files | 2 | 最多生成 BAT 文件数 |
| language | auto | 报告语言(auto/zh/en) |
CASE-001: Memory Search Function Broken
CASE-002: Gateway Service Not Starting
CASE-003: API Rate Limit Exceeded
CASE-004: Agent Spawn Failed
CASE-005: Channel Configuration Error
CASE-006: Model Provider Connection Failed
CASE-007: Configuration File Corrupted
CASE-008: Multiple Agents Conflict
CASE-009: Permission Denied Errors
CASE-010: Log File Too Large
# openclaw-iflow-doctor 触发配置
triggers:
on_error:
steps:
- step: 1
name: "Self heal attempt"
action: "auto_repair"
timeout: 30s
- step: 2
name: "Call iflow-helper"
condition: "step_1.failed"
skill: "iflow-helper"
args:
task: "diagnose_and_repair"
context: "{{error_description}}"
use_multimodal: true
┌─────────────────────────────────────────────────────────┐
│ OpenClaw Error │
└────────┬────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Self-Healing Analysis │
│ - Search cases.json (10 built-in cases) │
│ - Search records.json (historical fixes) │
└────────┬────────────────────────────────────────────────┘
│
┌────┴────┐
│ │
▼ ▼
┌──────┐ ┌──────────────────────────────────────────┐
│ Auto │ │ Generate Report + BAT │
│ Fix │ │ - 重新安装openclaw.bat │
│ │ │ - 打开iFlow寻求帮助.bat │
└──┬───┘ └──────────────┬───────────────────────────┘
│ │
▼ ▼
┌──────┐ ┌──────────────────────────────────────────┐
│Record│ │ Call iflow-helper │
│Success│ │ - Activate iflow CLI │
└──────┘ │ - User describes problem │
│ - iflow diagnoses │
│ - iflow fixes │
└──────────────┬───────────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ Sync to Memory │
│ - Save to records.json │
│ - Optional: sync to iflow memory │
│ - Update cases.json if reusable │
└──────────────────────────────────────────┘
# 检查 Python 版本
python3 --version # 需要 3.8+
# 检查文件权限
ls -la ~/.openclaw/skills/openclaw-iflow-doctor/
# 重新安装
openclaw skills reinstall openclaw-iflow-doctor
# 检查配置
openclaw skills config openclaw-iflow-doctor --get auto_heal
# 手动触发测试
openclaw skills run openclaw-iflow-doctor --test-trigger
# 检查 iflow-helper 是否安装
openclaw skills list | grep iflow-helper
# 手动安装
openclaw skills install iflow-helper
# 禁用 iflow 集成(纯本地模式)
openclaw skills config openclaw-iflow-doctor --set enable_iflow_integration=false
首次安装后启用自动模式:
openclaw skills config openclaw-iflow-doctor --set auto_heal=true
每周查看修复统计,了解系统稳定性:
openclaw skills run openclaw-iflow-doctor --stats
遇到新问题并成功修复后,添加到案例库:
openclaw skills run openclaw-iflow-doctor --add-case
复杂问题不要硬抗,及时调用 iflow:
openclaw skills run iflow-helper~/.openclaw/workspace/skills/iflow-helper/~/.openclaw/skills/openclaw-iflow-doctor/cases.json~/.openclaw/skills/openclaw-iflow-doctor/config.jsonOpenClaw Self-Healing V2 提供:
✅ 自动修复 - 80% 常见问题自动解决 ✅ 智能降级 - 复杂问题无缝转交 iflow ✅ 记忆积累 - 修复经验自动沉淀 ✅ 零配置 - 安装即用,开箱即用 ✅ 双向集成 - 与 iflow-helper 完美配合
建议: 与 iflow-helper 一起安装,获得最佳体验!