← 返回
未分类 中文

Acp Fallback

Automatically retries ACP vendors in priority order (codex, claude, pi, API) on failure, returning the first successful result with fallback logging.
失败时自动按优先级顺序(codex、claude、pi、API)重试 ACP 供应商,返回首个成功结果并记录回退日志。
engibarian engibarian 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 484
下载
💾 1
安装
1
版本
#latest

概述

ACP Fallback System - Resilient Agent Execution

Overview

This skill provides automatic fallback for ACP vendors (Codex → Claude → Pi → API) and model fallback for subagents. If one vendor fails, it automatically tries the next.

Usage

For Agents - Use acp_exec Function

# Instead of direct acpx calls, use this wrapper
source scripts/acp-fallback.sh && acp_exec "your task here"

ACP Vendor Priority (in order):

  1. codex - Primary (fast, reliable)
  2. claude - Fallback #1 (high quality)
  3. pi - Fallback #2 (lightweight)
  4. direct-api - Final fallback (uses OpenClaw's built-in models)

What Happens on Failure:

  • Vendor fails → Auto-retry with next vendor
  • All vendors fail → Log error, return failure status
  • Success → Return result immediately

Implementation

Core Functions

# acp_exec - Main entry point
# Usage: acp_exec "task description"
# Returns: Vendor used + result

# acp_exec_with_fallback - Full fallback chain
# Tries: codex → claude → pi → direct-api
# Returns: First successful result

# model_fallback - For subagent model switching
# Tries: MiniMax → DeepSeek → OpenAI → GLM-5

Agent Integration

Agents should call these functions instead of direct acpx commands:

  • Replace npx acpx codex exec "..." with acp_exec "..."
  • Replace single-model subagent with fallback-enabled wrapper

Error Handling

  • Network errors: Retry with next vendor after 3s
  • Auth errors: Skip to next vendor immediately
  • Rate limits: Wait 10s, then retry
  • Timeout (>120s): Move to next vendor

Logging

All fallback attempts logged to:

  • logs/acp-fallback.log

Success Metrics

Tracked:

  • Vendor used
  • Number of retries
  • Total time
  • Success/failure status

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-03 08:38 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,403 📥 323,955
dev-programming

Notification System

engibarian
跨平台(WhatsApp、Telegram、邮件)管理外发通知;处理模板、排程、投递跟踪和限流。
★ 0 📥 556
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,119 📥 839,742