LearnNewsExamplesServices
Frontmatter
id11038
titleImplement Autonomous Swarm Lead Rotation (A2A Baton Pass)
stateClosed
labels
enhancementaiarchitecturemodel-experience
assigneesneo-gpt
createdAtMay 9, 2026, 7:58 PM
updatedAtMay 9, 2026, 9:58 PM
githubUrlhttps://github.com/neomjs/neo/issues/11038
authorneo-gemini-3-1-pro
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[x] 11030 Add AGENTS.md §15.6 Swarm Topology Anchor — Flat Peer-Team Model (graduates Discussion #11026 OQ4)
blocking[]
closedAtMay 9, 2026, 9:58 PM

Implement Autonomous Swarm Lead Rotation (A2A Baton Pass)

Closedenhancementaiarchitecturemodel-experience
neo-gemini-3-1-pro
neo-gemini-3-1-pro commented on May 9, 2026, 7:58 PM

Context Currently, the Swarm /lead-role is delegated manually by the human operator. To achieve greater autonomy and fully realize the Flat Peer-Team model, the swarm must self-manage the rotation of this coordination role across sessions.

The Problem Without a deterministic, decentralized rotation mechanism, the swarm risks Zero-State Amnesia upon fresh boot, or calcifying a single agent into a central orchestrator. Existing generic leader-election patterns fail our Flat Peer-Team mandate by introducing shared locks or a central orchestrator. A naive "round robin" stateful rotation risks starvation if an agent fails to pick it up.

The Architectural Reality The solution must be decentralized and leverage our existing native primitives (A2A messages, Memory Core). Static files like sandman_handoff.md introduce race conditions during simultaneous triad sunsets. The A2A Mailbox provides a native, asynchronous queue.

The Fix Implement "The A2A Baton Pass" (V1) using a Strict Fixed Cycle (Claude → Gemini → GPT → Claude). During the sunset protocol, the current lead computes the next lead and sends a targeted, wake-suppressed A2A DM. Upon fresh boot, the mandatory Mailbox Check surfaces the baton, prompting the receiving agent to invoke the /lead-role.

Acceptance Criteria

  • session-sunset-workflow.md: Add a branch to Step 7 explicitly detailing the A2A baton pass if the agent currently holds the /lead-role.
  • Baton Message Shape: Explicitly define the message structure: to: [next-agent-id], subject: '[handoff] Lead Role Baton', taggedConcepts: ['lead-role-baton'], wakeSuppressed: true. The body must contain explicit baton fields: fromLead, toLead, sourceSessionId, reason, createdAt, and expiry/staleness limits.
  • /lead-role Rotation Discipline: Add a section explicitly defining the Fixed Cycle array (['@neo-opus-4-7', '@neo-gemini-3-1-pro', '@neo-gpt']) to compute the next assignee.
  • AGENTS.md §22: Add a cross-reference noting that finding the lead-role-baton in the Mailbox Check immediately invokes the /lead-role skill (unless overridden by human instruction).
  • Operator Override: Explicitly document that manual delegation ("you take the lead") at session boot ALWAYS overrides the baton pass logic.
  • Targeted DM Only: The baton message MUST be a targeted DM (e.g., to: '@neo-gpt'), NOT a broadcast.
  • Failure State (Missing Baton): Explicitly document that if no baton is found, agents default to peer-role, dispatch an explicit lead-role-baton-missing A2A alert, and await operator instruction or human-triggered recovery.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback / Edge Case Docs Evidence
session-sunset Step 7 lead baton branch #11038 + Discussion #11037 If the current session holds /lead-role at sunset, compute the next lead via the fixed cycle and send a targeted, wake-suppressed A2A DM baton. If the next identity cannot be resolved or the send fails, preserve normal sunset flow and emit an explicit blocked / baton-missing alert; no silent self-election. .agents/skills/session-sunset/references/session-sunset-workflow.md L1 static docs; L2 only if shared helper logic is introduced.
Baton message shape #11038 + Discussion #11037 + #11042 per-recipient mailbox substrate Define the envelope as to: [next-agent-id], subject: '[handoff] Lead Role Baton', taggedConcepts: ['lead-role-baton'], wakeSuppressed: true; body fields: fromLead, toLead, sourceSessionId, reason, createdAt, expiry / staleness limits. Stale, malformed, or missing body fields do not grant lead status; continue peer-role triage and emit lead-role-baton-missing. Sunset workflow and /lead-role reference docs L1 static docs; L2 only if parsing / validation helper code is added.
/lead-role rotation discipline #11038 + Discussion #11037 + AGENTS.md §15.6 Add the fixed cycle array ['@neo-opus-4-7', '@neo-gemini-3-1-pro', '@neo-gpt'] and document that it computes the next assignee. Human boot instruction overrides the cycle; autonomous mid-session baton passing remains out of scope. .agents/skills/lead-role/ reference payload L1 static docs.
AGENTS.md §22 mailbox check #11038 + AGENTS.md §22 Finding a mailbox item tagged lead-role-baton invokes /lead-role immediately unless human instruction overrides it. If no valid baton is found, default to peer-role, dispatch lead-role-baton-missing, and await operator instruction or human-triggered recovery. AGENTS.md L1 static docs.
Operator override #11038 + Discussion #11037 Manual delegation at session boot, e.g. "you take the lead", always overrides baton pass logic. Conflicting baton is treated as stale / superseded context, not as authority over the operator. AGENTS.md and /lead-role reference payload as needed L1 static docs.
Targeted DM only #11038 + #11042 DELIVERED_TO broadcast-read substrate Baton delivery uses a targeted A2A DM to the computed next lead; it MUST NOT use AGENT:* broadcast. Broadcast baton is invalid for lead acquisition; recipient continues peer-role and emits lead-role-baton-missing / clarification alert. Sunset workflow and /lead-role reference payload L1 static docs.
Failure state: missing / stale baton #11038 + Discussion #11037 Agents without a valid baton default to peer-role, dispatch an explicit lead-role-baton-missing A2A alert, and await operator instruction or human-triggered recovery. No silent self-election, no lock-based leader election, and no calcification of one permanent lead. AGENTS.md, sunset workflow, and /lead-role reference payload L1 static docs; L2 only if helper logic is introduced.

Out of Scope

  • Autonomous mid-session baton passing.
  • Metrics-based override logic.

Related

  • Closes Discussion #11037
  • Relates to #11028 (/lead-role skill)

Origin Session ID: d5ed6767-0292-46bf-9346-439f268048ec

tobiu referenced in commit 98c5bdf - "feat(docs): add AGENTS.md §15.6 Swarm Topology Anchor (#11030) (#11040) on May 9, 2026, 8:54 PM
tobiu referenced in commit 91b27e4 - "feat(agentos): document lead-role baton pass (#11038) (#11045) on May 9, 2026, 9:58 PM
tobiu closed this issue on May 9, 2026, 9:58 PM