smart-wake for Openclaw

A sophisticated state management and session recovery system that prevents data loss during subagent timeouts by using checkpoints and scheduled cron resumes.

cong91
v1.0.0
Mar 2, 2026
2
877
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install smart-wake

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install smart-wake using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is smart-wake?

smart-wake is a critical reliability framework for developers building complex Openclaw Skills that require extended execution times. By implementing a standardized checkpoint-and-resume architecture, it ensures that long-running tasks can survive the inherent timeout limits of subagents. This skill acts as a persistence layer, allowing an agent to save its progress, schedule a wake-up call via gateway cron jobs, and continue work in a fresh session without missing a beat.

At its core, smart-wake solves the challenge of non-deterministic or multi-hour workloads that exceed standard execution windows. Instead of failing when a timeout threshold is reached, the system orchestrates a graceful handoff using state persistence and session spawning. This makes it an indispensable tool for building resilient, enterprise-grade AI agents that must handle heavy data processing, repository-wide scans, or periodic background monitoring.

smart-wake Use Cases

  • Managing multi-hour repository analysis or codebase refactoring tasks that exceed default execution limits.
  • Automating periodic data polling and synchronization tasks that require background execution over several days.
  • Running high-complexity Openclaw Skills during off-hours with automated resumption and progress tracking.
  • Ensuring zero state loss for multi-step AI workflows that may pause for external dependency readiness.
  • Improving the reliability of agents performing large-scale content generation or batch processing.

How smart-wake Works

  1. Preflight Estimation: The agent calculates the total task duration and enables the smart-wake protocol if the estimate exceeds 70% of the session timeout.
  2. Chunked Execution: Tasks are broken down into manageable 5-15 minute segments to facilitate regular state updates.
  3. Checkpointing: After each chunk, the agent writes its current status, progress percentage, and next actions to a mandatory state contract.
  4. Pre-timeout Auto-save: As the timeout approaches (within 10-20% remaining time), the agent flushes a final checkpoint and sets its status to waiting.
  5. Gateway Cron Scheduling: The agent registers a cron wake event with the gateway, passing a payload containing the task ID and resume context.
  6. Session Resumption: At the scheduled time, a new session is spawned via session_spawn, which reads the latest checkpoint and resumes execution from the exact point of interruption.

smart-wake Setup

To integrate smart-wake into your Openclaw Skills, you must ensure your environment has access to gateway cron jobs and session management tools.

# Verify environment support for session management
openclaw tools list | grep "session_spawn"

Enable the protocol by implementing the mandatory state contract in your agent's memory slot and configuring your gateway to recognize the wakeMode parameter for cron-based resumption.

smart-wake Data Schema & Taxonomy

The smart-wake protocol relies on a strict state contract to ensure idempotency. Every task must maintain the following schema:

Field Description
task_id Unique identifier (e.g., smartwake_scan_20260101).
status Current lifecycle state: running, waiting, blocked, done, or failed.
progress_pct Integer representing task completion.
next_actions Array of steps to be performed after the next wake cycle.
artifacts List of generated file paths or data pointers to verify upon resume.
updated_at ISO timestamp of the last successful checkpoint.
retry_count Counter to prevent infinite wake loops (default max 5).

smart-wake Advanced Features

  • Idempotency Guard: Automatically verifies artifacts and checksums upon resumption to prevent redundant processing.
  • Dynamic Wake Intervals: Adjusts the cron schedule based on system load or task-specific dependencies.
  • Multi-Agent Orchestration: Supports session_spawn for delegating complex sub-tasks while maintaining the parent wake lifecycle.
  • Automated Cleanup: Triggers a teardown of all associated gateway cron jobs once the task status is marked as done.
  • Resume Context Injection: Passes optimized context to new sessions, ensuring the agent understands the objective and previous failures immediately upon wake-up.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*