feat(opencode): add agent teams — DB-based parallel multi-session collaboration#15205
Open
DXM666 wants to merge 7 commits intoanomalyco:devfrom
Open
feat(opencode): add agent teams — DB-based parallel multi-session collaboration#15205DXM666 wants to merge 7 commits intoanomalyco:devfrom
DXM666 wants to merge 7 commits intoanomalyco:devfrom
Conversation
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 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. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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
1912267 to
bd8dbcd
Compare
added 2 commits
February 27, 2026 16:52
- Add GET /team/:teamID/tasks HTTP route for listing team tasks - Add TeamTasksPanel TUI component with pending/in-progress/completed sections - Add Ctrl+T shortcut to toggle team tasks panel visibility - Sync team tasks on team.task.completed events - Regenerate SDK with Team client class and types Made-with: Cursor
Add a built-in /team command that instructs the agent to break down a task into subtasks and execute them in parallel using agent teams. Made-with: Cursor
Author
|
Update: Added 2 more commits: Commit 2 — HTTP route + TUI tasks panel + SDK
Commit 3 —
|
added 4 commits
February 27, 2026 18:14
Replace hardcoded { modelID: "default", providerID: "default" } fallback
with Provider.defaultModel() in spawn and wakeForMessage, consistent
with how the rest of the codebase resolves default models.
Made-with: Cursor
- Implement logic to switch to a lead session when a team member session is deleted. - Add a helper function to refresh team tasks upon task completion, creation, or claiming events. - Automatically display the team tasks panel for lead sessions. - Introduce new events for task creation and claiming to improve task tracking. Made-with: Cursor
- Add scrollable view to TeamTasksPanel for better task visibility. - Implement session cleanup logic to remove foreign key references before session deletion. - Introduce publishSessionUpdated function to notify TUI of session updates. - Improve error handling and logging during session removal and team cleanup processes. Made-with: Cursor
# Conflicts: # packages/opencode/src/cli/cmd/tui/context/sync.tsx # packages/opencode/src/cli/cmd/tui/routes/session/index.tsx # packages/opencode/src/config/config.ts # packages/opencode/src/id/id.ts # packages/opencode/src/server/server.ts # packages/opencode/src/session/index.ts # packages/opencode/src/session/session.sql.ts # packages/opencode/src/storage/schema.ts # packages/sdk/js/src/v2/gen/sdk.gen.ts # packages/sdk/js/src/v2/gen/types.gen.ts
This was referenced Mar 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Refs #12661, #5887, #12711
Type of change
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_roleonsession) to stay consistent with OpenCode's existing data layer. This is an alternative to the file-based approach in #12711.Other design points:
teamtool withactionparameter instead of multiple separate toolsFuture 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?
Screenshots / recordings
N/A — TUI changes are header badge, keyboard shortcuts, and a tasks panel.
Checklist