ExAgent.Session.TurnPolicy.SupervisorPolicy (ExAgent v1.0.0)

Copy Markdown View Source

A coordinator-driven turn order: a supervisor participant alternates with each worker in turn, forever.

The sequence is supervisor, worker[0], supervisor, worker[1], …, supervisor, worker[0], …. This models a "DM" or triage coordinator that stays in the loop between every worker action — useful when the supervisor must react (narrate, validate, re-route) each time a worker acts. The supervisor may also hand off mid-turn via ExAgent.Coordination.handoff/2, or delegate sub-tasks via ExAgent.Coordination.delegation_tool/2.

ExAgent.Session.start_link(
  shared_state: %{},
  policy: {:supervisor, supervisor: "dm", workers: ["rogue", "wizard"]},
  participants: [...]
)

:supervisor defaults to the first participant; :workers defaults to every other participant.

Summary

Types

t()

@type t() :: %ExAgent.Session.TurnPolicy.SupervisorPolicy{
  current: term() | nil,
  emit_supervisor_next: boolean(),
  supervisor: term() | nil,
  worker_index: non_neg_integer(),
  workers: [term()]
}