Skip to content

feat(opencode): add agent teams — DB-based parallel multi-session collaboration#15205

Open
DXM666 wants to merge 1 commit intoanomalyco:devfrom
DXM666:feat/agent-teams
Open

feat(opencode): add agent teams — DB-based parallel multi-session collaboration#15205
DXM666 wants to merge 1 commit intoanomalyco:devfrom
DXM666:feat/agent-teams

Conversation

@DXM666
Copy link

@DXM666 DXM666 commented Feb 26, 2026

Issue for this PR

Refs #12661, #5887, #12711

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds agent teams — a DB-based coordination system for parallel multi-session collaboration. A lead session can spawn multiple teammate sessions that work in parallel, communicate via messages, and share a task list.

Key architectural choice: uses SQLite/Drizzle (3 new tables: team, team_task, team_message + team_id/team_role on session) to stay consistent with OpenCode's existing data layer. This is an alternative to the file-based approach in #12711.

Other design points:

  • Single unified team tool with action parameter instead of multiple separate tools
  • Non-blocking spawn + wait-to-collect semantics
  • Shared task list with dependency tracking
  • Pending team messages are injected as synthetic user messages in the prompt loop
  • TUI header badge and Shift+Up/Down shortcuts to cycle team members

Future work (can be added incrementally): server restart recovery, plan approval, delegate mode, name-based addressing, full TUI sidebar.

How did you verify your code works?

  • Created teams, spawned multiple teammates with different agents, verified parallel execution
  • Tested point-to-point and broadcast messaging between teammates
  • Tested task create/claim/complete with dependency validation
  • Verified team cleanup properly archives and removes teammate sessions
  • Tested TUI header display and keyboard navigation between team sessions

Screenshots / recordings

N/A — TUI changes are minimal (header badge + keyboard shortcuts).

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Add a team coordination system that lets a lead session spawn and manage
multiple teammate sessions working in parallel. Built on SQLite/Drizzle
to stay consistent with OpenCode's existing data layer.

- 3 new DB tables: team, team_task, team_message
- Unified `team` tool with actions: create, spawn, wait, message,
  broadcast, tasks, status, shutdown, cleanup
- Non-blocking spawn with wait-to-collect semantics
- Shared task list with dependency tracking
- Prompt-level injection of pending team messages
- TUI: header badge and keyboard shortcuts to cycle team members

Refs anomalyco#12661, anomalyco#5887, anomalyco#12711

Made-with: Cursor
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 26, 2026
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found 1 potential duplicate:

PR #12730: feat: add agent team core — Team namespace, messaging, recovery, and events
#12730

This PR appears to be related as it also implements agent team functionality including messaging and recovery. It may overlap with the core team coordination features in the current PR.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 26, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant