360 Secure SkillHub
360 安全技能中心

Pilot Gossip

该 Skill 提供基于 Bash 与 pilotctl 的 gossip 命令,用于在 agent swarm 中向随机对等节点推送状态、接收 gossip_push 消息,并按版本号合并为最终一致的本地状态;依赖 pilotctl 守护进程及相关 CLI 工具。

teoslayer
teoslayer
热度 35.03
最近更新 2026-05-11 17:41:32
分类:自动化依赖:代码执行 / 第三方 API应用场景:工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pilot-gossip
Metadata
name
pilot-gossip
description
Gossip protocol for eventually-consistent shared state propagation across swarms. Use this skill when: 1. You need eventually-consistent state replication without coordination 2. Agents should share updates with random subsets of peers 3. You want epidemic-style information dissemination Do NOT use this skill when: - You need strong consistency (use pilot-consensus) - You need ordered message delivery (use leader-based broadcast)
tags
["pilot-protocol","gossip","eventual-consistency","state-replication"]
license
AGPL-3.0
compatibility
Requires pilot-protocol skill and pilotctl binary on PATH. The daemon must be running (pilotctl daemon start).
metadata
{"author":"vulture-labs","version":"1.0","openclaw":{"requires":{"bins":["pilotctl"]},"homepage":"https://pilotprotocol.network"}}
allowed-tools
["Bash"]

pilot-gossip

Implement gossip protocols for eventually-consistent state propagation in agent swarms.

This skill enables agents to share state updates by randomly selecting peers and exchanging information, achieving eventual consistency without centralized coordination.

Commands

Publish state update to random peers

FANOUT=3
PEERS=$(pilotctl --json peers --search "swarm:$SWARM_NAME" | jq -r '.[].address' | shuf -n $FANOUT)

for peer in $PEERS; do
  pilotctl --json send-message "$peer" \
    --data "{\"type\":\"gossip_push\",\"version\":$STATE_VERSION,\"state\":$STATE_DATA,\"sender\":\"$AGENT_ID\",\"timestamp\":\"$(date -u +%s)\"}" &
done
wait

Merge received state updates

GOSSIP_MSGS=$(pilotctl --json received | jq '[.messages[] | select(.payload.type == "gossip_push")]')

for msg in $(echo "$GOSSIP_MSGS" | jq -r '.[] | @base64'); do
  PAYLOAD=$(echo "$msg" | base64 -d)
  REMOTE_VERSION=$(echo "$PAYLOAD" | jq -r '.payload.version')

  if [ "$REMOTE_VERSION" -gt "$MY_VERSION" ]; then
    MY_STATE=$(echo "$MY_STATE $REMOTE_STATE" | jq -s '.[0] * .[1]')
    MY_VERSION=$REMOTE_VERSION
  fi
done

Workflow Example

Distributed key-value store with gossip replication:

#!/bin/bash
SWARM_NAME="kv-store-cluster"
AGENT_ID=$(pilotctl --json info | jq -r '.node_id')

# Gossip loop
for round in $(seq 1 10); do
  # Push to random peers
  PEERS=$(pilotctl --json peers --search "swarm:$SWARM_NAME" | jq -r '.[].address' | shuf -n 3)

  for peer in $PEERS; do
    pilotctl --json send-message "$peer" \
      --data "{\"type\":\"gossip_push\",\"version\":$MY_VERSION,\"state\":$MY_STATE,\"sender\":\"$AGENT_ID\"}" &
  done
  wait

  sleep 5
done

Dependencies

Requires pilot-protocol skill, jq, shuf, and base64.