Install
openclaw skills install agent-monitorAgent work status monitoring and automatic activation system. Triggers when monitoring subagent runtime status, detecting prolonged unresponsive "stalled" states, and automatically activating them to resume operation. Suitable for long-running task monitoring, automated operations, agent health checks, and similar scenarios.
openclaw skills install agent-monitorThis skill provides subagent work status monitoring and automatic activation capabilities:
Use the subagents tool to obtain a list of currently running agents:
# List recently running agents
subagents(action="list", recentMinutes=30)
Detection logic:
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="<agent-id>", message="Continue working")
┌─────────────────────┐
│ Get Agent List │
└──────────┬──────────┘
▼
┌─────────────────────┐
│ Check Each Agent's │
│ Last Activity Time │
└──────────┬──────────┘
▼
┌────────┐
│ >5min? ├──No──┐
└────┬───┘ │
Yes│ │
▼ │
┌─────────────────────┐│
│ Determine as ││
│ Stalled Status ││
└──────────┬──────────┘│
▼ │
┌─────────────────────┐│
│ Send Activation ││
│ Message to Resume ││
└─────────────────────┘│
│ │
└───────────┘
▼
┌─────────────────┐
│ Continue Monitoring│
└─────────────────┘
# 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")
# 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)
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 monitorThe 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