← 返回
开发者工具

AI Agent 自省调试框架

AI Agent 自省调试框架 - 让 AI Agent 具备自我诊断和自动修复能力。用于捕获错误、根因分析、自动修复、生成报告。
AI Agent 自省调试框架 - 让 AI Agent 具备自我诊断和自动修复能力。用于捕获错误、根因分析、自动修复、生成报告。
danihe001
开发者工具 clawhub v1.1.0 1 版本 99852.7 Key: 无需
★ 0
Stars
📥 678
下载
💾 22
安装
1
版本
#error-handling#introspection#latest#self-healing

概述

AI Agent 自省调试框架

让 AI Agent 具备自省和自我修复能力。

功能

功能描述
------------
全局错误捕获自动拦截 uncaughtException 和 unhandledRejection
根因分析基于规则库匹配常见错误 (80%+)
自动修复自动创建文件、修复权限、安装依赖
报告生成生成结构化自省报告
人类通知无法修复时通知人类

支持的错误类型

  • 文件缺失 (ENOENT)
  • 权限错误 (EACCES)
  • 模块缺失 (MODULE_NOT_FOUND)
  • 连接超时 (ETIMEDOUT)
  • 限流 (429)
  • 服务器错误 (500-504)
  • 内存溢出 (OOM)
  • 进程被终止 (SIGKILL)
  • 认证错误 (401/403)

使用方法

1. 引入模块

const IntrospectionDebugger = require('./introspection-debugger');

2. 创建实例

const debugger = new IntrospectionDebugger({
  workspace: process.cwd(),
  maxHistorySize: 100,
  notificationHook: async (report) => {
    // 通知人类
    console.log('需要人工:', report.recommendation.message);
  }
});

3. 手动捕获错误

try {
  // 你的代码
} catch (e) {
  debugger.catch(e, { source: 'my-code' });
}

4. 查看统计

console.log(debugger.getStats());
// { totalErrors: 10, totalFixes: 8, autoFixRate: 0.8 }

文件

  • introspection-debugger.js - 主框架代码
  • reliable-api-client.js - API 客户端黄金标准

相关文档

  • INTROSPECTION_DEBUGGER.md - 详细使用文档
  • EVOMAP_STANDARD.md - 胶囊发布规范

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-20 00:36 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

suspicious
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,150
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,164
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,796