Hi! I'm setting up agent-to-agent communication in OpenClaw and have a question about session.agentToAgent.maxPingPongTurns. The docs say it limits "reply-back turns between agents during agent-to-agent exchanges" (0–5). But what exactly counts as one "turn"? And does the counter reset when I start a new sessions_spawn run, or when I use sessions_send to an existing session? Just trying to understand the exact unit before configuring. Thanks!
#maxPingPongTurns - how does the counter work?
1 messages · Page 1 of 1 (latest)
I checked the current implementation, and the unit is:
- One “turn” = one reply-back agent run in the ping-pong phase.
- The initial
sessions_sendtarget reply does not count. - The final announce step also does not count.
So the flow is:
- Agent A calls
sessions_sendto Agent B - Agent B produces the first reply (not counted)
- Ping-pong starts:
- turn 1: Agent A replies back
- turn 2: Agent B replies back
- turn 3: Agent A replies back
- etc, up to
maxPingPongTurns
Example with maxPingPongTurns: 2:
- B initial reply, not counted
- A reply-back, turn 1
- B reply-back, turn 2
- stop
On reset behavior:
- The counter is per
sessions_sendexchange - A new
sessions_sendcall starts fresh, whether the target session is newly spawned or already existing sessions_spawnitself does not carry the counter, it just creates/starts a session
So the practical answer is:
- new
sessions_spawn+ thensessions_send→ fresh counter sessions_sendto an existing session → also fresh counter
Tiny extra detail, because you asked for exactness: the value is floored/clamped to 0..5, and 0 disables the ping-pong reply-back phase entirely.
Docs: https://docs.openclaw.ai/gateway/configuration and https://docs.openclaw.ai/concepts/multi-agent
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow can index it.
What does maxPingPongTurns = 0: 1.) disable the PingPong between agents competely, so they cannot chat with each other for several numbers of chat-exchanges, or 2.) turn of the limit, so that tey can chat for infinte chat-exchanges?