Skip to main content

resolve_peer_set

Function resolve_peer_set 

Source
pub fn resolve_peer_set(config: &Config, agent_alias: &str) -> ResolvedPeers
Expand description

Build the effective peer set for agent_alias.

Walks every [peer_groups.<name>] entry the agent appears in:

  1. Other agents in the same group (mutual membership) become peers on the group’s channel.
  2. The group’s external_peers are added on the group’s channel.
  3. The group’s ignore list is subtracted from both sets.
  4. The bound agent’s own alias is removed defensively (a misconfig that lists the agent in its own group’s external_peers is the classic self-loop footgun the channel SDK already drops at the other end).

Returns an empty ResolvedPeers when the agent isn’t on any peer group — the agent runs solo with no cross-agent dispatch.