← 返回 Skills 市场
kaiyuelv

ClawHub Retry & Fallback

作者 Lv Lancer · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
258
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install clawhub-retry-fallback
功能描述
ClawHub平台工具调用失败自动重试与降级处理Skill | Automatic retry and fallback handling for ClawHub Agent task failures
使用说明 (SKILL.md)

ClawHub Retry & Fallback Skill

为ClawHub平台Agent任务提供完整的容错兜底机制,实现「异常可感知、失败可重试、无招可兜底」的闭环。

核心功能

功能模块 说明 PRD对应
全局重试策略配置中心 支持指数退避、固定间隔、自定义间隔策略 4.1节
异常类型智能识别引擎 自动区分可重试/不可重试异常 4.2节
备用工具自动切换 智能匹配备用工具池,自动参数映射 4.3节
三级降级处理机制 轻度/中度/重度降级策略 4.4节
全流程执行日志 支持导出Excel/PDF,满足审计要求 4.5节

快速开始

from scripts.retry_handler import RetryHandler

handler = RetryHandler()

@handler.with_retry(max_attempts=3, backoff_strategy='exponential')
def my_api_call():
    # 你的API调用
    return requests.get('https://api.example.com/data')

# 自动重试执行
result = my_api_call()

安装

pip install -r requirements.txt

项目结构

clawhub-retry-fallback/
├── SKILL.md                 # Skill说明文档
├── README.md                # 完整文档 (API参考+9个示例)
├── requirements.txt         # 依赖列表
├── config/
│   └── retry_policies.yaml  # 重试策略配置
├── scripts/                 # 6个核心模块
│   ├── retry_handler.py     # 重试处理器
│   ├── exception_classifier.py  # 异常分类器
│   ├── fallback_manager.py  # 备用工具管理器
│   ├── degradation_handler.py   # 降级处理器
│   ├── audit_logger.py      # 审计日志
│   └── config_manager.py    # 配置管理器
├── examples/
│   └── basic_usage.py       # 9个使用示例
└── tests/
    └── test_retry_handler.py    # 22个单元测试

运行测试

cd tests
python test_retry_handler.py

# 预期输出:
# Ran 22 tests in X.XXXs
# OK

运行示例

cd examples
python basic_usage.py

# 输出9个完整示例

详细文档

请参考 README.md 获取:

  • 完整API参考文档
  • 9个渐进式使用示例
  • 配置文件说明
  • 异常分类规则库
  • 高级用法指南
安全使用建议
This skill appears coherent with its stated purpose. Before installing, do the following: 1) Run the test suite and examples in an isolated environment to confirm runtime behavior (the package writes audit logs and may create config files under ./logs and config/). 2) Review/confirm any backup functions you register (fallback.register_backup) do not themselves call untrusted remote endpoints or handle secrets — the fallback manager executes user-provided functions. 3) Note minor implementation issues in the included files (missing imports/typos in truncated code paths) — expect potential runtime errors; run in a sandbox first. 4) If you will store logs in a shared location, ensure sensitive data is not logged or is redacted. If you want higher assurance, request the full untruncated source or run a security code review focusing on any file I/O and any user-supplied callback execution paths.
功能分析
Type: OpenClaw Skill Name: clawhub-retry-fallback Version: 1.0.1 The clawhub-retry-fallback skill bundle is a well-structured utility designed to provide fault tolerance, retry logic, and fallback mechanisms for AI agent tasks. Analysis of the core modules (scripts/retry_handler.py, scripts/fallback_manager.py, scripts/degradation_handler.py) and the documentation (SKILL.md, README.md) shows that the code strictly follows its stated purpose without any indicators of malicious intent, data exfiltration, or prompt injection. The bundle includes comprehensive unit tests and follows standard software engineering practices for configuration and logging.
能力评估
Purpose & Capability
Name/description (retry, fallback, degradation for ClawHub agents) match the provided modules: retry_handler, exception_classifier, fallback_manager, degradation_handler, audit_logger, and config_manager. There are no unrelated required binaries, env vars, or config paths declared.
Instruction Scope
SKILL.md and examples restrict actions to configuring and invoking local retry/fallback/degradation logic and exporting logs. Example code shows calling external APIs (placeholder https://api.example.com) but that is user-driven sample code — the skill itself does not embed hidden remote endpoints or instruct the agent to read unrelated system state. The skill will write logs and configs to disk (./logs and configurable paths) and can export files; consider where those files are stored.
Install Mechanism
No install spec in metadata (instruction-only install via pip -r requirements.txt is recommended in SKILL.md). requirements.txt lists small, well-known Python packages (retry, pyyaml, python-json-logger). Nothing indicates an unsafe external installer or arbitrary download URL.
Credentials
The skill declares no required environment variables or credentials. Code interacts with local filesystem (logs, config) and loads a local YAML config; that aligns with purpose. There are no unexpected credential accesses in the reviewed files.
Persistence & Privilege
The skill does not request always: true or other elevated platform privileges. It persists logs and optionally writes config files (save_config) under provided paths; this is consistent with an audit/config manager and not a privilege escalation.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install clawhub-retry-fallback
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /clawhub-retry-fallback 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
修复bug并完善文档
v1.1.0
完善文档和示例 - 新增完整API参考文档和9个渐进式使用示例
v1.0.0
Initial release - 工具调用失败自动重试与降级处理Skill
元数据
Slug clawhub-retry-fallback
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 3
常见问题

ClawHub Retry & Fallback 是什么?

ClawHub平台工具调用失败自动重试与降级处理Skill | Automatic retry and fallback handling for ClawHub Agent task failures. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 258 次。

如何安装 ClawHub Retry & Fallback?

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

ClawHub Retry & Fallback 是免费的吗?

是的,ClawHub Retry & Fallback 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

ClawHub Retry & Fallback 支持哪些平台?

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

谁开发了 ClawHub Retry & Fallback?

由 Lv Lancer(@kaiyuelv)开发并维护,当前版本 v1.0.1。

💬 留言讨论