← 返回
开发者工具

ClawHub Retry & Fallback

ClawHub平台工具调用失败自动重试与降级处理Skill | Automatic retry and fallback handling for ClawHub Agent task failures
ClawHub平台工具调用失败自动重试与降级处理Skill | Automatic retry and fallback handling for ClawHub Agent task failures
kaiyuelv
开发者工具 clawhub v1.0.1 1 版本 99811.7 Key: 无需
★ 1
Stars
📥 510
下载
💾 7
安装
1
版本
#latest

概述

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个渐进式使用示例
  • 配置文件说明
  • 异常分类规则库
  • 高级用法指南

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-31 15:36 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Api Test Automation

kaiyuelv
API接口测试自动化工具,支持REST/GraphQL,包含接口测试、性能测试、契约测试、Mock服务等功能 | API Test Automation for REST/GraphQL with performance, contract
★ 1 📥 2,101
developer-tools

Github

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

Gog

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