Long Run Mode for Openclaw

A robust execution protocol designed to manage, monitor, and recover sustained multi-step AI agent tasks through structured state management.

ffffff9331
v0.1.4
Apr 2, 2026
0
151
0

Install & Download

1. ClawHub CLI

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

npx clawhub@latest install long-run-mode

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 long-run-mode 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 Long Run Mode?

Long Run Mode acts as a specialized task execution protocol rather than a simple prompt. It is engineered for complex operations that require multiple steps and extended durations, providing a framework for task framing, state recording, and session routing. By integrating this into Openclaw Skills, developers ensure that AI agents remain accountable and visible through mandatory progress heartbeats, preventing tasks from running into silent loops or losing state during long-duration work cycles.

The skill operates under strict trigger boundaries, only activating when the user explicitly requests long task mode. It includes a comprehensive suite of Python scripts to handle the lifecycle of a task, from initial state registration to watchdog-based recovery and cross-session message dispatching.

Long Run Mode Use Cases

  • Performing large-scale code refactoring or repository-wide migrations.
  • Executing multi-stage data research and synthesis tasks that span hours.
  • Managing background system audits or deployment monitoring with automated recovery.
  • Handling complex workflows where the agent must survive session timeouts or connectivity interruptions.

How Long Run Mode Works

  1. The protocol is triggered by specific command phrases such as "enter long task mode".
  2. The agent initializes the task by recording the goal, state, and completion conditions in a persistent JSON schema using task_state.py.
  3. Mandatory session binding occurs via validate_task_start.py to ensure heartbeats are routed to the correct origin_session_key.
  4. During execution, the agent must invoke work_cycle_tick.py to send foreground progress updates every few minutes.
  5. A background watchdog script monitors activity timestamps and triggers recovery if the task stalls or loses contact.

Long Run Mode Setup

To integrate this protocol into your Openclaw Skills environment, follow these steps:

# Navigate to your skills directory and ensure the scripts are executable
chmod +x skills/long-run-mode/scripts/*.py

# Install the watchdog cron job to monitor background tasks
bash skills/long-run-mode/scripts/install_watchdog_cron.sh

# (Optional) Run the local watchdog loop for debugging
bash skills/long-run-mode/scripts/watchdog_loop.sh

Long Run Mode Data Schema & Taxonomy

The skill manages task state through a structured JSON schema. Below are the primary fields used to track long-running operations within Openclaw Skills:

Field Type Description
task String Unique name of the task.
state Enum Current status: analyzing, executing, waiting, blocked, handoff, or done.
origin_session_key String The unique ID of the session where the task started.
progress_every Duration Interval for mandatory foreground heartbeats (default 3m).
goal String The primary objective of the long-running task.
last_progress_at ISO8601 Timestamp of the last visible progress report sent to the user.

Long Run Mode Advanced Features

  • Foreground Heartbeat Priority: Forces agents to report status before continuing work if the progress interval has elapsed.
  • Watchdog Auditing: Automatically detects desynchronized tasks or timed-out tool calls and generates recovery plans.
  • Multi-Session Dispatching: Supports sending status updates to different UI boundaries like Telegram, web consoles, or management dashboards.
  • Self-Healing Recovery: Uses emit_keepalive_resume.py to generate payloads that restart stalled tasks in their original context.
  • Strict Boundary Control: Prevents accidental activation and ensures that only explicit requests trigger resource-intensive monitoring.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*