[PR #12816] Add Team coordination system for parallel AI agent workflows #14384

Closed
opened 2026-02-16 18:19:11 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12816

State: closed
Merged: No


What does this PR do?

This PR introduces a comprehensive Team system that enables multiple AI agents to work together in parallel on complex tasks. The system includes:

Core Components:

  • Team namespace: Creates and manages teams of AI agents with a lead coordinator and multiple teammates
  • TaskBoard: Manages task creation, claiming, and completion with dependency tracking
  • TeamMessageBus: Enables inter-agent communication for coordination
  • FileClaim: Prevents file conflicts by allowing agents to claim files before editing

Key Features:

  • Parallel execution: All teammates run concurrently on independent tasks
  • Task dependencies: Tasks can depend on other tasks completing first
  • File locking: Agents claim files to avoid simultaneous edits
  • Status tracking: Real-time monitoring of team progress and agent status
  • Pause/resume: Teams can be paused mid-execution and resumed later
  • Event publishing: All state changes publish to the bus for external monitoring

Tool Integration:

  • New TeamTool provides user-facing actions: create, status, pause, resume, and message
  • Integrated into the tool registry for use in agent workflows
  • Identifier prefixes added for team entities (team, teammate, team_task, team_message)

Why this works:
The system uses a coordinator pattern where the lead agent orchestrates work while teammates execute tasks independently. Each agent gets a system prompt describing available tasks, team members, and recent messages. Agents claim tasks and files before working on them, preventing conflicts. The task board tracks dependencies to ensure work happens in the correct order. All state is persisted to storage and published as events, allowing external monitoring and recovery.

How did you verify your code works?

The implementation follows established patterns in the codebase:

  • Uses the same Storage, Bus, and Session abstractions as other features
  • Follows the namespace pattern used throughout (Team, TaskBoard, etc.)
  • Integrates with existing Identifier system for ID generation
  • Tool definition matches the Tool.define pattern used by other tools
  • Event publishing matches existing BusEvent patterns
  • Zod schemas validate all data structures

The team execution flow is straightforward: create team → spawn lead + teammate sessions → run teammates in parallel → each teammate gets a prompt with task context → teammates claim and complete tasks → team completes when all tasks done or fails if any task fails.

https://claude.ai/code/session_016LVKkYdkqHoRiAQdzPFvtp

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12816 **State:** closed **Merged:** No --- ### What does this PR do? This PR introduces a comprehensive Team system that enables multiple AI agents to work together in parallel on complex tasks. The system includes: **Core Components:** - `Team` namespace: Creates and manages teams of AI agents with a lead coordinator and multiple teammates - `TaskBoard`: Manages task creation, claiming, and completion with dependency tracking - `TeamMessageBus`: Enables inter-agent communication for coordination - `FileClaim`: Prevents file conflicts by allowing agents to claim files before editing **Key Features:** - Parallel execution: All teammates run concurrently on independent tasks - Task dependencies: Tasks can depend on other tasks completing first - File locking: Agents claim files to avoid simultaneous edits - Status tracking: Real-time monitoring of team progress and agent status - Pause/resume: Teams can be paused mid-execution and resumed later - Event publishing: All state changes publish to the bus for external monitoring **Tool Integration:** - New `TeamTool` provides user-facing actions: create, status, pause, resume, and message - Integrated into the tool registry for use in agent workflows - Identifier prefixes added for team entities (team, teammate, team_task, team_message) **Why this works:** The system uses a coordinator pattern where the lead agent orchestrates work while teammates execute tasks independently. Each agent gets a system prompt describing available tasks, team members, and recent messages. Agents claim tasks and files before working on them, preventing conflicts. The task board tracks dependencies to ensure work happens in the correct order. All state is persisted to storage and published as events, allowing external monitoring and recovery. ### How did you verify your code works? The implementation follows established patterns in the codebase: - Uses the same Storage, Bus, and Session abstractions as other features - Follows the namespace pattern used throughout (Team, TaskBoard, etc.) - Integrates with existing Identifier system for ID generation - Tool definition matches the Tool.define pattern used by other tools - Event publishing matches existing BusEvent patterns - Zod schemas validate all data structures The team execution flow is straightforward: create team → spawn lead + teammate sessions → run teammates in parallel → each teammate gets a prompt with task context → teammates claim and complete tasks → team completes when all tasks done or fails if any task fails. https://claude.ai/code/session_016LVKkYdkqHoRiAQdzPFvtp
yindo added the pull-request label 2026-02-16 18:19:11 -05:00
yindo closed this issue 2026-02-16 18:19:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14384