#maxPingPongTurns - how does the counter work?

1 messages · Page 1 of 1 (latest)

faint hearth
#

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!

lyric sedgeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

glad lagoonBOT
late remnantBOT
#

I checked the current implementation, and the unit is:

  • One “turn” = one reply-back agent run in the ping-pong phase.
  • The initial sessions_send target reply does not count.
  • The final announce step also does not count.

So the flow is:

  1. Agent A calls sessions_send to Agent B
  2. Agent B produces the first reply (not counted)
  3. 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_send exchange
  • A new sessions_send call starts fresh, whether the target session is newly spawned or already existing
  • sessions_spawn itself does not carry the counter, it just creates/starts a session

So the practical answer is:

  • new sessions_spawn + then sessions_send → fresh counter
  • sessions_send to 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.

faint hearth
#

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?