自动模型故障切换守护。当主模型连续失败时自动切换到可用兜底模型,稳定后自动尝试切回主模型。适用于保证 OpenClaw 服务连续性。
Scanned 9/5/2026
Install to Claude Code
npx -y skills add dvcrn/openclaw-skills-marketplace --skill model-failover-guard --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Model Failover Guard?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/dvcrn-model-failover-guard)More formats (shields.io, HTML) on the badges page.
---
name: model-failover-guard
description: 自动模型故障切换守护。当主模型连续失败时自动切换到可用兜底模型,稳定后自动尝试切回主模型。适用于保证 OpenClaw 服务连续性。
---
# Model Failover Guard
给 OpenClaw 提供"主模型故障自动切换 + 恢复自动切回"。
## 通用逻辑
1. 从用户 `~/.openclaw/openclaw.json` 读取当前默认主模型(或使用 `config.json` 指定 `primaryModel`)
2. 主模型连续失败达到阈值后,从"所有已配置模型"里选择可用兜底
3. 兜底候选按 `preferredFallbackProvider` 优先,其余模型按字典序
4. 在兜底稳定运行达到阈值后,尝试切回主模型
5. 切回失败则立即回退到兜底,避免抖动
## 配置文件
复制 `config.example.json` 为 `config.json` 并按需修改:
- `primaryModel`: 可空;空则自动使用 openclaw 当前默认主模型
- `preferredFallbackProvider`: 可空;可指定你偏好的 fallback provider
- `excludedProviders`: 不参与兜底的 provider 列表
- `failThreshold`: 故障切换阈值(默认 3)
- `recoverThreshold`: 切回阈值(默认 3)
- `checkIntervalSec`: 检查间隔(默认 300 秒)
## 文件
- 守护脚本:`{baseDir}/scripts/failover.py`
- 示例配置:`{baseDir}/config.example.json`
- 运行状态:`~/.openclaw/failover-state.json`
- 日志:`~/.openclaw/failover.log`
## 常用操作
### 单次检查(不常驻)
```bash
python3 {baseDir}/scripts/failover.py once
```
### 常驻运行(前台)
```bash
python3 {baseDir}/scripts/failover.py loop
```
### 查看日志
```bash
tail -n 50 ~/.openclaw/failover.log
```
## 安全边界
- 不会删除文件
- 仅在触发条件满足时改 `agents.defaults.model.primary` 并重启 gateway
- 所有切换行为写日志,便于审计Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.
Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...
Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.
**Complete production-ready guide for Google Gemini embeddings API** This skill provides comprehensive coverage of the `gemini-embedding-001` model for generating text embeddings, including SDK usage, REST API patterns, batch processing, RAG integration with Cloudflare Vectorize, and advanced use cases like semantic search and document clustering. ---
Recovers prior coding-agent session context by running `catchup <agent> --since-compact`, which extracts a clean summary of a previous Codex, Claude Code, Antigravity, OpenCode, or Pi Agent session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", or asks to recover/summarize a previous session before continuing. Do NOT use for the current conversation, git history, or any non-agent log.