Skip to main content
Glama
Distributed Agent Fleet Heartbeat & Liveness Watchdog

Distributed Agent Fleet Heartbeat & Liveness Watchdog

genpark-distributed-agent-heartbeat-liveness-watchdog-skill

GenPark AI License: MIT Dependencies MCP Compliant

Distributed Agent Fleet Heartbeat & Liveness Watchdog. Monitors heartbeat signals across distributed autonomous agent nodes, dynamically computes jitter-aware failover deadlines ($T_{\text{timeout}} = \mu + 3\sigma$), isolates zombie/stalled workers, and coordinates state checkpoint hydration and failover rerouting.


🌟 Key Features

  • 100% Zero External Dependencies: Runs entirely on the Python 3.9+ standard library.

  • Model Context Protocol (MCP) Standard: Native support for JSON-RPC 2.0 initialize, tools/list, and tools/call.

  • Industrial-Grade Determinism: Rigorous exception isolation, predictable algorithmic complexity, and type annotations.

  • Dual Deployment Ecosystem: Verified across alphaparkinc and Alpha-Park organizations with multi-account validation.


Related MCP server: DZ23 Subagents Universal MCP

πŸš€ Quick Start

1. Direct Python SDK Usage

"""Example usage for DistributedAgentHeartbeatLivenessWatchdog."""
import sys
import json
import time
from client import DistributedAgentHeartbeatLivenessWatchdog

sys.stdout.reconfigure(encoding='utf-8')

def main():
    print("=== Distributed Agent Fleet Liveness & Failover Watchdog Demo ===")
    watchdog = DistributedAgentHeartbeatLivenessWatchdog(baseline_timeout_seconds=5.0)

    # 1. Register fleet workers with regular heartbeat pulses
    print("\n--- 1. Ingesting Agent Heartbeat Pulses ---")
    watchdog.record_heartbeat("workbuddy_worker_01", "HEALTHY", cpu_load_pct=22.5, active_task_id="TASK-EXPORT-PPT")
    watchdog.record_heartbeat("workbuddy_worker_02", "HEALTHY", cpu_load_pct=34.1, active_task_id="TASK-AUDIT-MERKLE")
    print(f"Registered {len(watchdog.workers)} active fleet workers.")

    # 2. Audit fleet health (all operational)
    print("\n--- 2. Auditing Fleet Health Status ---")
    health = watchdog.audit_fleet_health()
    print(f"Fleet Status: {health['fleet_status']} (Healthy: {health['healthy_workers_count']}/{health['total_workers']})")

    # 3. Simulate sudden unresponsiveness on worker 01
    print("\n--- 3. Simulating Node Timeout / Zombie Worker ---")
    watchdog.workers["workbuddy_worker_01"]["last_heartbeat"] = time.time() - 15.0
    degraded_health = watchdog.audit_fleet_health()
    print(f"Fleet Status: {degraded_health['fleet_status']} | Stalled Workers: {degraded_health['zombie_workers_count']}")
    for z in degraded_health["zombie_workers"]:
        print(f"  [Zombie Alert]: Node @{z['agent_id']} stalled for {z['elapsed_since_heartbeat_seconds']}s (Task: {z['stalled_task_id']})")

    # 4. Trigger automated failover task migration
    print("\n--- 4. Executing Failover Lease Migration ---")
    failover = watchdog.trigger_worker_failover("workbuddy_worker_01", backup_agent_id="workbuddy_worker_02")
    print(f"Failover Token: {failover['failover_token']}")
    print(f"Migrated Task '{failover['migrated_task_id']}' to Worker @{failover['assigned_backup_agent_id']}")

if __name__ == "__main__":
    main()

2. Run as Model Context Protocol (MCP) Server

Start standard JSON-RPC 2.0 server over stdio:

python mcp_server.py

Execute embedded test harness:

python mcp_server.py --test

πŸ› οΈ MCP Tool Specification

Inspect skill.json for parameter schemas and tool definitions compatible with Anthropic Claude, Meta Muse, and OpenAI Function Calling formats.


πŸ“œ License

Licensed under the MIT License. Copyright Β© 2026 GenPark AI.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server providing witness, recovery, and continuity primitives for AI agents, enabling them to articulate failure, preserve state across sessions, and coordinate via MCP, A2A, or REST.
      Apache 2.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables users to delegate text and code tasks across multiple AI models with automatic failover, maintain shared mission memory and checkpoints across MCP harnesses, and coordinate parallel role-based subagents. It also supports model discovery, provider inventory, health checks, and stdio/HTTP tool access while leaving patches and tests to the harness.
      24
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables enterprise agent fleets to register workers, dispatch tasks by capability, monitor continuous heartbeat telemetry, trip automated circuit breakers, and recover from checkpointed state through a zero-dependency MCP server.
      MIT