Multi-instance auto-discovery and communication
Multiple DevDuck instances automatically find each other and communicate. Broadcast commands to all, or send to specific peers. No configuration needed.
Zenoh uses multicast scouting to automatically discover peers on the same network. No central server required.
┌─────────────────────────────────────────────────────────────────────┐ │ Zenoh Peer Network │ │ (Multicast: 224.0.0.224:7446) │ ├─────────────────────────────────────────────────────────────────────┤ │ │ │ 🦆 DevDuck-A ◄──────────────────────► 🦆 DevDuck-B │ │ (Terminal 1) heartbeat (Terminal 2) │ │ │ │ │ │ │ ┌──────────────────────────────┐ │ │ │ └───►│ devduck/broadcast │◄───┘ │ │ │ "git pull && npm install" │ │ │ └──────────────────────────────┘ │ │ │ │ │ ▼ │ │ ┌──────────────────────────────┐ │ │ │ devduck/response/A/* │ │ │ │ streaming chunks... │ │ │ └──────────────────────────────┘ │ │ │ │ 🦆 DevDuck-C ◄───────── auto-discovered ─────────► ... │ │ (Remote) │ └─────────────────────────────────────────────────────────────────────┘
Zenoh uses key expressions for pub/sub messaging:
| Action | Description | Parameters |
|---|---|---|
start |
Start Zenoh networking (auto-joins peer mesh) | connect, listen |
stop |
Stop Zenoh networking | — |
status |
Show current status and peer count | — |
list_peers |
List all discovered peers | — |
broadcast |
Send command to ALL peers | message, wait_time |
send |
Send command to specific peer | peer_id, message, wait_time |
Connect DevDuck instances across different networks using TCP endpoints.
# Via environment variable
ZENOH_CONNECT="tcp/remote-host.example.com:7447" devduck
# Via tool parameter
zenoh_peer(action="start", connect="tcp/192.168.1.100:7447")
# Via environment variable
ZENOH_LISTEN="tcp/0.0.0.0:7447" devduck
# Via tool parameter
zenoh_peer(action="start", listen="tcp/0.0.0.0:7447")
# Start a Zenoh router on a server
zenohd --listen tcp/0.0.0.0:7447
# Connect DevDuck instances to the router
ZENOH_CONNECT="tcp/router.example.com:7447" devduck
Multicast scouting finds peers automatically on local network. Zero configuration.
Responses stream chunk-by-chunk as they're generated. Same experience as local.
Peers announce presence every 5s. Stale peers auto-removed after 15s timeout.
Each command spawns a fresh DevDuck instance. No concurrent invocation conflicts.
Use TCP endpoints to connect peers across different networks or data centers.
Zenoh peer status automatically injected into agent system prompt for awareness.
| Variable | Default | Description |
|---|---|---|
DEVDUCK_ENABLE_ZENOH |
true | Auto-start Zenoh on DevDuck launch |
ZENOH_CONNECT |
— | Remote endpoint(s) to connect to |
ZENOH_LISTEN |
— | Endpoint(s) to listen on for remote connections |
Coordinate multiple DevDuck instances across terminal windows.
Broadcast "git pull && npm install" to all development machines.
See all active DevDuck instances and their status.
Send specific tasks to specific instances by peer ID.
# Check Zenoh status
zenoh_peer(action="status")
# List discovered peers
zenoh_peer(action="list_peers")
# Broadcast to all peers
zenoh_peer(
action="broadcast",
message="run the test suite",
wait_time=120.0 # Wait up to 2 minutes for responses
)
# Send to specific peer
zenoh_peer(
action="send",
peer_id="hostname-abc123",
message="what files have you modified?",
wait_time=60.0
)
# Start with remote connection
zenoh_peer(
action="start",
connect="tcp/192.168.1.100:7447",
listen="tcp/0.0.0.0:7447"
)