← 返回 Skills 市场
lidekahdjdhdhsjjs-lang

Huizai Error Guard

作者 lidekahdjdhdhsjjs-lang · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
567
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install hz-error-guard
功能描述
Monitors, classifies, intercepts errors in real-time, enforces auto-retry and circuit breaking, and ensures graceful recovery and prevention.
使用说明 (SKILL.md)

error-guard - 错误守卫

功能

实时监控错误、自动拦截、预防问题

核心机制

1. 错误分类

致命错误 (立即处理)

  • 内存溢出
  • 磁盘满
  • 认证失效
  • 系统崩溃

严重错误 (快速处理)

  • API 超时
  • 连接失败
  • 权限不足

警告 (记录并监控)

  • 速率限制
  • 临时失败
  • 资源紧张

信息 (仅记录)

  • 调试日志
  • 性能指标

2. 错误模式识别

def detect_error_pattern(errors):
    # 检测重复错误
    if len(set(errors[-5:])) == 1:
        return "repeating_error"
    
    # 检测错误累积
    if error_rate() > threshold:
        return "error_accumulation"
    
    # 检测级联错误
    if has_cascade(errors):
        return "cascade_failure"
    
    return "isolated_error"

3. 自动拦截规则

IF 同一错误出现 3 次 THEN
    记录并警告
    暂停相关操作
    进入熔断模式
END

IF 错误率 > 10% THEN
    降低操作频率
    增加重试延迟
    通知管理员
END

IF 致命错误 THEN
    保存完整上下文
    执行优雅关闭
    触发重启
END

4. 错误预防

# 执行前验证
async def pre_execution_check(command):
    checks = {
        "auth": verify_token(),
        "resources": check_resources(),
        "rate_limit": check_rate_limit(),
        "dependencies": check_services()
    }
    
    if not all(checks.values()):
        raise PreExecutionError("验证失败")
    
    return True

5. 错误恢复

async def error_recovery(error):
    strategies = {
        "auth_error": refresh_and_retry,
        "timeout_error": retry_with_backoff,
        "rate_limit_error": wait_and_retry,
        "resource_error": free_resources_and_retry
    }
    
    strategy = strategies.get(error.type, default_retry)
    return await strategy(error)

🦞 辉仔 - 错误终结者

安全使用建议
This skill appears to implement an agent control-plane watchdog and is internally consistent with that purpose. Before installing: 1) Review whether you are comfortable with the skill creating skills/error-guard/state.json in the agent working directory. 2) Note the skill can spawn isolated sub-agents and send events to sessions — expected for monitoring but increases blast radius if misused. 3) The flush/recover functions call SDK process.kill to terminate exec sessions; confirm that behavior is acceptable in your environment. 4) Test in a sandboxed agent first and restrict its use (or require explicit user invocation) until you are satisfied. If you want higher assurance, ask the author for signed releases or a hosted repository and verify the SDK calls (sessions_spawn/sessions_send/process.kill) are constrained by your platform's permission model.
功能分析
Type: OpenClaw Skill Name: hz-error-guard Version: 1.0.0 The skill is classified as suspicious due to the `flush()` function in `control.ts`. This function uses the `@openclaw/sdk` to enumerate all active sessions (`process.list`) and then programmatically kill them (`process.kill`). While described as an 'emergency stop' for an 'error-guard' skill, this capability grants the skill the power to terminate arbitrary agent sessions, posing a significant risk for denial of service or unintended disruption if misused or triggered by faulty logic. This is a high-risk capability that could be exploited, rather than clear evidence of intentional malice like data exfiltration or backdoor installation.
能力评估
Purpose & Capability
The name/description (error monitoring, circuit breaking, auto-retry) match the code and SKILL.md: control plane, watchdog evaluation, worker helpers, and sub-agent spawning are all present and expected for this purpose.
Instruction Scope
SKILL.md stays on-topic (error detection, pre-checks, recovery strategies). It does not instruct reading unrelated system files or exfiltrating data. The code implements event emission, registry persistence, heartbeat evaluation, and control commands consistent with the documented behavior.
Install Mechanism
No install spec (instruction-only) is provided. The package includes TypeScript runtime files but does not download external archives or run remote installers. No high-risk install URLs are present.
Credentials
The skill requests no credentials or special env vars, which aligns with its scope. It does persist a small state file to process.cwd()/skills/error-guard/state.json — this is reasonable for a local registry but you should note it writes to disk under the agent's working directory.
Persistence & Privilege
always:false and model invocation allowed (default). The code can spawn sub-agents (sessions_spawn), send messages to main sessions (sessions_send), and (on flush) list/kill execution sessions via the SDK (process.list/process.kill). Those capabilities are coherent for an emergency control-plane, but they are powerful: a flush call can attempt to terminate other exec sessions. The skill does not modify other skills' configs directly, and persistence is limited to its own state file.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install hz-error-guard
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /hz-error-guard 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of hz-error-guard - Provides real-time error monitoring and interception with preventive measures. - Categorizes errors into fatal, severe, warning, and informational levels for targeted response. - Includes automatic error pattern detection (repetition, accumulation, cascading). - Implements interception and mitigation rules, including circuit-breaking and alerting. - Offers pre-execution validation and automated error recovery strategies.
元数据
Slug hz-error-guard
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Huizai Error Guard 是什么?

Monitors, classifies, intercepts errors in real-time, enforces auto-retry and circuit breaking, and ensures graceful recovery and prevention. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 567 次。

如何安装 Huizai Error Guard?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install hz-error-guard」即可一键安装,无需额外配置。

Huizai Error Guard 是免费的吗?

是的,Huizai Error Guard 完全免费(开源免费),可自由下载、安装和使用。

Huizai Error Guard 支持哪些平台?

Huizai Error Guard 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Huizai Error Guard?

由 lidekahdjdhdhsjjs-lang(@lidekahdjdhdhsjjs-lang)开发并维护,当前版本 v1.0.0。

💬 留言讨论