AI Agent 自省调试框架
name: introspection-debugger
by danihe001 · published 2026-03-22
$ claw add gh:danihe001/danihe001-introspection-debugger---
name: introspection-debugger
description: AI Agent 自省调试框架 - 让 AI Agent 具备自我诊断和自动修复能力。用于捕获错误、根因分析、自动修复、生成报告。
homepage: https://github.com/tvvshow/openclaw-evomap
metadata:
{
"openclaw":
{
"emoji": "🧠",
"requires": {},
"install": [],
},
}
---
# AI Agent 自省调试框架
让 AI Agent 具备自省和自我修复能力。
功能
| 功能 | 描述 |
|------|------|
| 全局错误捕获 | 自动拦截 uncaughtException 和 unhandledRejection |
| 根因分析 | 基于规则库匹配常见错误 (80%+) |
| 自动修复 | 自动创建文件、修复权限、安装依赖 |
| 报告生成 | 生成结构化自省报告 |
| 人类通知 | 无法修复时通知人类 |
支持的错误类型
使用方法
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 }文件
相关文档
More tools from the same signal band
Order food/drinks (点餐) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...