← Back to Skills Marketplace
openlark

Agent Monitor

by OpenLark · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
86
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install agent-monitor
Description
Agent work status monitoring and automatic activation system. Triggers when monitoring subagent runtime status, detecting prolonged unresponsive "stalled" st...
README (SKILL.md)

Agent Monitor - Agent Work Status Monitoring

Overview

This skill provides subagent work status monitoring and automatic activation capabilities:

  1. Status Monitoring - Real-time monitoring of agent runtime status
  2. Stall Detection - Detecting "stalled" states where an agent has been unresponsive for over 5 minutes
  3. Automatic Activation - Automatically sending activation messages to resume agent operation

Core Capabilities

1. Monitor Agent Status

Use the subagents tool to obtain a list of currently running agents:

# List recently running agents
subagents(action="list", recentMinutes=30)

2. Detect Stalled Status

Detection logic:

  • Obtain the agent's last activity time
  • Calculate the difference from the current time
  • If over 5 minutes (300 seconds) with no activity → Determine as "stalled"

3. Automatically Activate Agents

Use the steer action of the subagents tool to send an activation message:

# Send an activation message to a specified agent
subagents(action="steer", target="\x3Cagent-id>", message="Continue working")

Workflow

┌─────────────────────┐
│  Get Agent List     │
└──────────┬──────────┘
           ▼
┌─────────────────────┐
│ Check Each Agent's  │
│  Last Activity Time │
└──────────┬──────────┘
           ▼
      ┌────────┐
      │ >5min? ├──No──┐
      └────┬───┘      │
          Yes│         │
           ▼          │
┌─────────────────────┐│
│  Determine as       ││
│  Stalled Status     ││
└──────────┬──────────┘│
           ▼           │
┌─────────────────────┐│
│  Send Activation    ││
│  Message to Resume  ││
└─────────────────────┘│
           │           │
           └───────────┘
                 ▼
        ┌─────────────────┐
        │ Continue Monitoring│
        └─────────────────┘

Usage Examples

Example 1: Monitor All Agents

# 1. Get agent list
result = subagents(action="list", recentMinutes=30)

# 2. Check each agent's status
for agent in result.agents:
    idle_time = calculate_idle_time(agent.lastActivity)
    if idle_time > 300:  # Over 5 minutes
        # 3. Automatically activate
        subagents(action="steer", target=agent.id, message="Please continue executing the task")

Example 2: Monitor a Specific Agent

# Monitor an agent with a specified ID
agent_id = "builder-agent-001"
result = subagents(action="list", recentMinutes=10)

# Find the target agent
for agent in result.agents:
    if agent.id == agent_id:
        if is_stalled(agent, threshold=300):
            activate_agent(agent_id)

Script Tool

monitor_agents.py

Located at scripts/monitor_agents.py, provides complete monitoring functionality:

# Monitor and automatically activate stalled agents
python scripts/monitor_agents.py --threshold 300 --auto-activate

# Detect only, without automatic activation
python scripts/monitor_agents.py --threshold 300 --dry-run

# Monitor a specific agent
python scripts/monitor_agents.py --target agent-id-001

Parameter descriptions:

  • --threshold: Stall determination threshold (seconds), default 300 (5 minutes)
  • --auto-activate: Automatically activate stalled agents
  • --dry-run: Detect only, do not execute activation
  • --target: Specify a specific agent ID to monitor

Integration into Scheduled Tasks

The monitoring script can be integrated into cron scheduled tasks for continuous monitoring:

# Check every 2 minutes
*/2 * * * * python /path/to/monitor_agents.py --auto-activate

Notes

  1. Threshold Setting: Adjust the stall determination threshold based on the task type; complex tasks may require longer thresholds
  2. Activation Message: Activation messages sent should be concise and clear, prompting the agent to continue working
  3. Avoid False Activation: Ensure the agent is genuinely stalled before activating to avoid interfering with normal thought processes
  4. Logging: It is recommended to log each detection and activation operation for subsequent analysis
Usage Guidance
The skill is internally consistent with its description, but review these before installing: (1) Confirm your platform provides a 'subagents' tool or API and understand what permissions it grants — this skill will call 'steer' to send messages to other agents. (2) Test in dry-run mode first (--dry-run) and enable logging to avoid accidental activations. (3) Limit use of --auto-activate in production or schedule it behind safeguards (rate limits, allowlist of target agents). (4) If you allow autonomous invocation, be aware it can affect other agents' execution; consider requiring manual confirmation for activation in sensitive environments.
Capability Analysis
Type: OpenClaw Skill Name: agent-monitor Version: 1.0.0 The agent-monitor skill is a utility designed to monitor the activity of subagents and restart them if they become unresponsive. It uses standard OpenClaw tool calls (subagents list/steer) as described in its documentation, and the provided Python script (monitor_agents.py) contains no malicious logic, data exfiltration, or obfuscation.
Capability Assessment
Purpose & Capability
Name/description describe monitoring and automatic activation; the SKILL.md and the included script both call the platform-provided 'subagents' tool (in comments) to list and 'steer' agents. No unrelated credentials, binaries, or install steps are requested.
Instruction Scope
Instructions and the script stay within the stated scope (list agents, compute idle time, send activation messages). Worth noting: the skill explicitly instructs sending messages to other agents ('steer'), so misuse or misconfiguration could cause undesired activations — but this is consistent with its purpose.
Install Mechanism
No install spec and only a single Python script are included. Nothing is downloaded from external URLs or written to unusual locations.
Credentials
The skill declares no required environment variables or credentials, and the code does not read external secrets or config paths. It relies on the platform 'subagents' tool (expected for this functionality).
Persistence & Privilege
always:false (normal). The capability to autonomously activate other agents (when run with --auto-activate or invoked by the agent) increases operational blast radius — this is a functional requirement but a privilege to be considered when granting runtime autonomy.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install agent-monitor
  3. After installation, invoke the skill by name or use /agent-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of agent-monitor skill: monitors subagent status, detects stalls, and auto-activates stalled agents. - Real-time monitoring of agent runtime status. - Detects and handles "stalled" agents unresponsive for over 5 minutes. - Sends automatic activation messages to resume stalled agents. - Includes a script (`scripts/monitor_agents.py`) with options for thresholds, dry-run, and targeting specific agents. - Designed for easy integration with scheduled tasks for continuous operation.
Metadata
Slug agent-monitor
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Agent Monitor?

Agent work status monitoring and automatic activation system. Triggers when monitoring subagent runtime status, detecting prolonged unresponsive "stalled" st... It is an AI Agent Skill for Claude Code / OpenClaw, with 86 downloads so far.

How do I install Agent Monitor?

Run "/install agent-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Agent Monitor free?

Yes, Agent Monitor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Agent Monitor support?

Agent Monitor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Agent Monitor?

It is built and maintained by OpenLark (@openlark); the current version is v1.0.0.

💬 Comments