feat: add Agent Team experimental feature for parallel sub-agent coordination#75
Open
BingqingLyu wants to merge 7 commits into
Open
feat: add Agent Team experimental feature for parallel sub-agent coordination#75BingqingLyu wants to merge 7 commits into
BingqingLyu wants to merge 7 commits into
Conversation
…dination Adds an experimental Agent Team feature that lets the lead agent spawn and coordinate a team of sub-agents working in parallel on different parts of a task. Key components: - TeamManager: central orchestrator for teammate lifecycle and message routing - Mailbox: file-based message passing system - Task board: shared task tracker with status and dependency support - Identity system: unique IDs, display names, and colors for teammates - Permission sync: propagates leader approvals to teammates - 6 new gated tools: team_create, team_delete, send_message, task_create, task_update, task_list Feature is disabled by default and gated behind experimental setting or env var. 🤖 Generated with [Qwen Code](https://github.com/QwenLM/qwen-code) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
useResultDisplayRenderer had no handler for TeamResultDisplay or
TaskListResultDisplay objects. In interactive mode, team_create and
team_delete returned {type, teamName, action} which fell through to
the default case casting it as string, crashing React with "Objects
are not valid as a React child."
Add explicit branch for team_result/task_list types and make the
default fallback safe with typeof check + JSON.stringify.
The test mock config was missing `getTeamManager` and `onTeamManagerChange`, causing all 56 tests to fail with "config.onTeamManagerChange is not a function".
# Conflicts: # packages/cli/src/nonInteractiveCli.ts # packages/core/src/tools/agent.test.ts # packages/core/src/tools/agent.ts
This was referenced Apr 28, 2026
Owner
Author
Conflict Group 1This PR shares modified functions with 14 other PR(s): #106, #112, #113, #114, #117, #14, #17, #18, #36, #46, #6, #71, #86, #88. These PRs should be reviewed as a batch — merging one may affect the others.
graph LR
PR75["PR #75"]
FconsumePendingMemoryTaskPromises_3380["consumePendingMemoryTaskPromises<br>client.ts"]
PR75 -->|modifies| FconsumePendingMemoryTaskPromises_3380
PR114["PR #114"]
PR114 -->|modifies| FconsumePendingMemoryTaskPromises_3380
PR117["PR #117"]
PR117 -->|modifies| FconsumePendingMemoryTaskPromises_3380
FisSdkMcpServerConfig_803["isSdkMcpServerConfig<br>config.ts"]
PR75 -->|modifies| FisSdkMcpServerConfig_803
PR106["PR #106"]
PR106 -->|modifies| FisSdkMcpServerConfig_803
PR112["PR #112"]
PR112 -->|modifies| FisSdkMcpServerConfig_803
PR113["PR #113"]
PR113 -->|modifies| FisSdkMcpServerConfig_803
PR114 -->|modifies| FisSdkMcpServerConfig_803
PR117 -->|modifies| FisSdkMcpServerConfig_803
PR18["PR #18"]
PR18 -->|modifies| FisSdkMcpServerConfig_803
PR46["PR #46"]
PR46 -->|modifies| FisSdkMcpServerConfig_803
PR86["PR #86"]
PR86 -->|modifies| FisSdkMcpServerConfig_803
PR88["PR #88"]
PR88 -->|modifies| FisSdkMcpServerConfig_803
FloadCliConfig_6977["loadCliConfig<br>config.ts"]
PR75 -->|modifies| FloadCliConfig_6977
PR106 -->|modifies| FloadCliConfig_6977
PR112 -->|modifies| FloadCliConfig_6977
PR113 -->|modifies| FloadCliConfig_6977
PR114 -->|modifies| FloadCliConfig_6977
PR117 -->|modifies| FloadCliConfig_6977
PR36["PR #36"]
PR36 -->|modifies| FloadCliConfig_6977
PR46 -->|modifies| FloadCliConfig_6977
PR86 -->|modifies| FloadCliConfig_6977
PR88 -->|modifies| FloadCliConfig_6977
FnormalizeConfigOutputFormat_803["normalizeConfigOutputFormat<br>config.ts"]
PR75 -->|modifies| FnormalizeConfigOutputFormat_803
PR106 -->|modifies| FnormalizeConfigOutputFormat_803
PR112 -->|modifies| FnormalizeConfigOutputFormat_803
PR113 -->|modifies| FnormalizeConfigOutputFormat_803
PR114 -->|modifies| FnormalizeConfigOutputFormat_803
PR117 -->|modifies| FnormalizeConfigOutputFormat_803
PR18 -->|modifies| FnormalizeConfigOutputFormat_803
PR86 -->|modifies| FnormalizeConfigOutputFormat_803
PR88 -->|modifies| FnormalizeConfigOutputFormat_803
FrunNonInteractive_8467["runNonInteractive<br>nonInteractiveCli.ts"]
PR75 -->|modifies| FrunNonInteractive_8467
PR114 -->|modifies| FrunNonInteractive_8467
PR14["PR #14"]
PR14 -->|modifies| FrunNonInteractive_8467
PR17["PR #17"]
PR17 -->|modifies| FrunNonInteractive_8467
PR6["PR #6"]
PR6 -->|modifies| FrunNonInteractive_8467
PR71["PR #71"]
PR71 -->|modifies| FrunNonInteractive_8467
Posted by codegraph-ai conflict detection. |
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.
TLDR
Adds Agent Team — an experimental feature that lets the lead agent spawn and coordinate a team of sub-agents working in parallel on different parts of a task. The feature is off by default and gated behind an experimental setting or environment variable.
Screenshots / Video Demo
N/A — no user-facing UI change beyond new tools appearing when the feature is enabled. The interaction happens entirely through tool calls within a conversation.
Dive Deeper
Why Agent Team?
Today, the Agent tool runs sub-agents one at a time — the leader spawns an agent, waits for it to finish, reads the result, then spawns the next. This is fine for small tasks, but falls apart when:
Agent Team solves this by introducing a leader–teammate model: the lead agent creates a team, spawns teammates that run concurrently, and coordinates them through messages and a shared task board.
How to enable
The feature is disabled by default. Enable it with either option (env var takes priority):
~/.qwen/settings.json:{ "experimental": { "agentTeam": true } }QWEN_CODE_ENABLE_AGENT_TEAM=1A session restart is required after changing the setting. When disabled, none of the team tools are registered and the feature has zero runtime cost.
New tools (6 total, all gated behind the setting)
team_createteam_deletesend_messagetask_createtask_updatetask_listCommon workflow
A typical agent team session follows this pattern:
team_createwith a descriptive nametask_createfor each subtask (e.g., "validate /users endpoint", "validate /orders endpoint", "update user tests", etc.)Agenttool to spawn teammates; each teammate gets an identity, a name, and a color for UI displaytask_listto find pending tasks, claims one viatask_update(status: "in_progress"), does the work, then reports results back to the leader viasend_messagetask_list, and can post follow-up tasks or send instructions to specific teammatesteam_deleteto shut down all teammates and clean up team stateTeammates can also communicate with each other via
send_message, which is useful when one agent's findings affect another's work.Architecture overview
~/.qwen/teams/{name}/inboxes/); messages are persisted so they survive agent restarts~/.qwen/tasks/{name}/); tasks have statuses (pending → in_progress → completed) and dependency tracking (blocks/blockedBy)name@teamName), display name, and color; identity propagates through AsyncLocalStorage for in-process agentsBackend support
The existing agent backends are extended to support team-aware spawning:
Known limitations and pitfalls
MAX_TEAMMATES = 10). Creating more will error. In practice, 2–4 teammates is the sweet spot — more agents means more coordination overhead.team_createwhile a team is already active will fail — you mustteam_deletefirst.Reviewer Test Plan
Feature gate works:
QWEN_CODE_ENABLE_AGENT_TEAM=1→ confirm all 6 tools appearUnit tests pass:
E2E smoke test (with feature enabled):
Testing Matrix
Linked issues / bugs
No linked issues
🤖 Generated with Qwen Code