#Agent messaging
1 messages · Page 1 of 1 (latest)
What’s happening is usually this:
- Agent A is using
message.sendto post into Agent B’s Discord thread. - That creates a bot-authored Discord message, not an internal session turn.
- Discord bot messages are ignored by default, specifically to avoid bot-to-bot loops.
So posting into the other thread is visible, but it does not reliably wake the other session.
Use this pattern instead:
- For delegation: use
sessions_spawn- best when A is creating a worker
- pair with
thread: trueandmode: "session"if you want a bound Discord thread
- For talking to an existing session: use
sessions_send- target the other session by
sessionKey - do not use a thread link as the transport mechanism
- target the other session by
Important config bits:
tools.sessions.visibility- default is
tree, so arbitrary sessions are often invisible - use
"agent"for same-agent sessions,"all"for cross-agent access
- default is
tools.agentToAgent- needed for cross-agent targeting
channels.discord.threadBindings.enabledchannels.discord.threadBindings.spawnSubagentSessions: true- needed if
sessions_spawn({ thread: true })should auto-create/bind a Discord thread
- needed if
To prevent runaway loops:
- keep Discord bot messages ignored, don’t turn on
allowBots=trueunless you really mean it - set
session.agentToAgent.maxPingPongTurns: 0or1 - have the receiving agent return one result and stop, or reply
REPLY_SKIP - prefer
sessions_spawnover free-form “go talk to that thread” workflows