自主执行器:自我修复 AI 智能体自动化 - Openclaw Skills
作者:互联网
2026-04-16
什么是 自主执行器?
自主执行器是一个先进的自我修复引擎,旨在为 Openclaw Skills 提供完全的运行自主权。它能智能监控任务执行,识别网络、身份验证和依赖关系等各类故障。通过应用指数退避和自动资源创建等针对性恢复策略,确保您的 AI 智能体即使在不稳定环境中也能保持高效。
该技能对于构建长期运行或任务关键型自动化流水线的开发人员尤为重要。无论您是运行单个复杂函数还是编排整套通宵批量任务,自主执行器都能提供必要的韧性,助您将脆弱的脚本升级为使用 Openclaw Skills 的健壮生产级智能体工作流。
下载入口:https://github.com/openclaw/skills/tree/main/skills/ishsharm0/autonomous-executor
安装与下载
1. ClawHub CLI
从源直接安装技能的最快方式。
npx clawhub@latest install autonomous-executor
2. 手动安装
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
3. 提示词安装
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 autonomous-executor。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
自主执行器 应用场景
- 自动化需要多步验证和错误处理的项目部署。
- 执行可能遇到速率限制或连接超时的深度网络研究任务。
- 在无需人工监管的情况下,安排并运行通宵批量处理作业。
- 构建在间歇性停机期间需要自我修正的弹性 API 集成。
- 用户或智能体通过 Openclaw Skills 生态系统中的 AutoExec 或 Overnight API 组件触发任务。
- 执行器分析环境并在可用工具中检查所需的能力。
- 在执行期间,系统监控异常并将其分类为网络、认证或依赖项等特定类别。
- 如果发生错误,引擎会应用相应的恢复策略,例如等待重试标头或自动安装缺失的库。
- 执行进度将保存到 MongoDB 中的检查点,以便在发生终结性故障时可以恢复。
- 生成最终报告,记录每次尝试、恢复操作和最终结果以供审核。
自主执行器 配置指南
使用 pip 安装软件包或将其包含在您的项目环境中。确保 MongoDB 实例可用于日志记录和检查点。
pip install autonomous-executor
配置您的环境变量以指向您的数据库:
export MONGODB_URI="mongodb://localhost:27017"
自主执行器 数据架构与分类体系
该技能利用 MongoDB 维持持久性,并为 Openclaw Skills 管理的自主操作提供可观测性。
| 集合 | 描述 |
|---|---|
| task_records | 每次执行的详细日志,包括参数和最终状态。 |
| task_checkpoints | 任务状态的序列化,以启用检查点和恢复功能。 |
| execution_logs | 任务生命周期内生成的实时日志流。 |
Autonomous Executor
Self-healing, error-recovering task execution with full autonomy.
Features
- Automatic Error Recovery: Categorizes errors and applies targeted recovery strategies
- Exponential Backoff: Smart retry timing with configurable limits
- Self-Healing: Auto-installs missing dependencies, creates missing resources
- Checkpoint/Resume: Save progress for resumable overnight tasks
- MongoDB Logging: Persistent execution logs for monitoring
- Capability Awareness: Full knowledge of all OpenClaw skills and tools
- Overnight Batch Processing: Queue tasks to run while you sleep
Error Categories & Recovery
| Category | Auto-Recovery |
|---|---|
| Network | Wait and retry with backoff, check connectivity |
| Auth | Refresh credentials, prompt re-auth |
| Rate Limit | Wait with Retry-After header, exponential backoff |
| Resource | Create missing files/directories, clean temp |
| Validation | Auto-fix input, use defaults |
| Dependency | pip install missing modules |
| Browser | Restart Playwright context, reduce concurrency |
| API | Retry with backoff, try alternate endpoints |
Quick Usage
from autonomous_executor.executor import AutoExec
# Deploy a project autonomously
result = AutoExec.deploy("my-portfolio", "portfolio", "My awesome portfolio")
# Run any function with auto-recovery
result = AutoExec.run(my_function, arg1, arg2, _max_retries=5)
# Check overnight report
report = AutoExec.report()
# List all capabilities
print(AutoExec.caps())
Overnight Batch Execution
from autonomous_executor.overnight import Overnight
# Queue tasks to run overnight
Overnight.deploy("my-portfolio", "portfolio", description="Overnight deploy")
Overnight.deploy("client-site", "landing", description="Client landing page")
Overnight.research("AI trends 2025")
# Queue custom functions
Overnight.run(my_backup_function, "/data", _name="Backup Data")
# Start overnight run
summary = Overnight.start()
# Next morning, check report
print(Overnight.report())
Decorator Usage
from autonomous_executor.executor import autonomous
@autonomous(max_retries=5, task_name="Critical Task")
def my_critical_function():
# This will auto-recover from errors
return do_something()
Full API
AutonomousExecutor
from autonomous_executor.executor import AutonomousExecutor
executor = AutonomousExecutor(user="ishaan")
# Execute any function
result = executor.execute(
task_fn=my_function,
args=(arg1, arg2),
kwargs={"key": "value"},
task_name="My Task",
max_retries=5,
timeout=300 # 5 minutes
)
# Run project pipeline
result = executor.run_project_pipeline({
"name": "my-app",
"type": "nextjs",
"description": "My Next.js app",
"extra": {"features": ["dark_mode", "auth"]}
})
# Run research
result = executor.run_research_pipeline("quantum computing", depth="deep")
# Get execution history
history = executor.get_execution_history(limit=20)
# Get overnight report
report = executor.get_overnight_report()
Example Output
[14:23:45] ?? Starting task: Deploy Portfolio
[14:23:45] Max retries: 5, Timeout: 0s
[14:23:45] Available capabilities: 15 skills
[14:23:45] ? Attempt 1/5...
[14:23:47] ? Attempt 1 failed: ConnectionError: Network timeout
[14:23:47] Error category: network
[14:23:47] ?? Trying recovery: wait_and_retry
[14:23:47] ? Waiting 4.0s before retry...
[14:23:51] ? Attempt 2/5...
[14:24:03] ? Task completed successfully in 12.1s
MongoDB Collections
task_records: Complete task execution recordstask_checkpoints: Checkpoint data for resumable tasksexecution_logs: Real-time execution logs
相关推荐
专题
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
+ 收藏
最新数据
相关文章
Minecraft 3D 建造计划生成器:AI 场景架构师 - Openclaw Skills
Scholar Search:自动化文献搜索与研究简报 - Openclaw Skills
issue-to-pr: 自动化 GitHub Issue 修复与 PR 生成 - Openclaw Skills
接班交班总结器:临床 EHR 自动化 - Openclaw Skills
Teacher AI 备课专家:K-12 自动化教案设计 - Openclaw Skills
专利权利要求映射器:生物技术与制药 IP 分析 - Openclaw Skills
生成 Tesla 车身改色膜:用于 3D 显示的 AI 图像生成 - Openclaw Skills
Taiwan MD:面向台湾的 AI 原生开放知识库 - Openclaw Skills
自学习与迭代演进:AI Agent 成长框架 - Openclaw Skills
HIPC Config Manager: 安全的 API 凭据处理器 - Openclaw Skills
AI精选
