← Back to Skills Marketplace
kaiyuelv

ClawHub Retry & Fallback

by Lv Lancer · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
258
Downloads
0
Stars
1
Active Installs
3
Versions
Install in OpenClaw
/install clawhub-retry-fallback
Description
ClawHub平台工具调用失败自动重试与降级处理Skill | Automatic retry and fallback handling for ClawHub Agent task failures
README (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个渐进式使用示例
  • 配置文件说明
  • 异常分类规则库
  • 高级用法指南
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install clawhub-retry-fallback
  3. After installation, invoke the skill by name or use /clawhub-retry-fallback
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
修复bug并完善文档
v1.1.0
完善文档和示例 - 新增完整API参考文档和9个渐进式使用示例
v1.0.0
Initial release - 工具调用失败自动重试与降级处理Skill
Metadata
Slug clawhub-retry-fallback
Version 1.0.1
License MIT-0
All-time Installs 1
Active Installs 1
Total Versions 3
Frequently Asked Questions

What is ClawHub Retry & Fallback?

ClawHub平台工具调用失败自动重试与降级处理Skill | Automatic retry and fallback handling for ClawHub Agent task failures. It is an AI Agent Skill for Claude Code / OpenClaw, with 258 downloads so far.

How do I install ClawHub Retry & Fallback?

Run "/install clawhub-retry-fallback" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is ClawHub Retry & Fallback free?

Yes, ClawHub Retry & Fallback is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does ClawHub Retry & Fallback support?

ClawHub Retry & Fallback is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created ClawHub Retry & Fallback?

It is built and maintained by Lv Lancer (@kaiyuelv); the current version is v1.0.1.

💬 Comments