mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
feat: 将 Agents/Teams 工具纳入 Tool Search 按需发现
将 TeamCreate、TeamDelete、SendMessage 从 CORE_TOOLS 移除, 使其成为 deferred 工具,通过 ToolSearch 按需发现以减少 context token。 swarm 模式下 SendMessage 保持 always loaded,TeamCreate/TeamDelete 在 swarm 未启用时调用返回启用提示。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -73,7 +73,8 @@ function generateUniqueTeamName(providedName: string): string {
|
||||
|
||||
export const TeamCreateTool: Tool<InputSchema, Output> = buildTool({
|
||||
name: TEAM_CREATE_TOOL_NAME,
|
||||
searchHint: 'create a multi-agent swarm team',
|
||||
searchHint:
|
||||
'create multi-agent swarm team, collaborate, parallel agents, task distribution, agent coordination, team management',
|
||||
maxResultSizeChars: 100_000,
|
||||
shouldDefer: true,
|
||||
|
||||
@@ -86,7 +87,7 @@ export const TeamCreateTool: Tool<InputSchema, Output> = buildTool({
|
||||
},
|
||||
|
||||
isEnabled() {
|
||||
return isAgentSwarmsEnabled()
|
||||
return true
|
||||
},
|
||||
|
||||
toAutoClassifierInput(input) {
|
||||
@@ -126,6 +127,12 @@ export const TeamCreateTool: Tool<InputSchema, Output> = buildTool({
|
||||
},
|
||||
|
||||
async call(input, context) {
|
||||
if (!isAgentSwarmsEnabled()) {
|
||||
throw new Error(
|
||||
'Agent Teams 功能未启用。请确保未设置 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS_DISABLED 环境变量。',
|
||||
)
|
||||
}
|
||||
|
||||
const { setAppState, getAppState } = context
|
||||
const { team_name, description: _description, agent_type } = input
|
||||
|
||||
|
||||
Reference in New Issue
Block a user