feat(agent-teams): gate agent-teams tools behind experimental.agent_teams flag

This commit is contained in:
YeonGyu-Kim 2026-02-11 11:41:44 +09:00
parent 386521d185
commit 4282de139b
2 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,8 @@ export const ExperimentalConfigSchema = z.object({
plugin_load_timeout_ms: z.number().min(1000).optional(),
/** Wrap hook creation in try/catch to prevent one failing hook from crashing the plugin (default: true at call site) */
safe_hook_creation: z.boolean().optional(),
/** Enable experimental agent teams toolset (default: false) */
agent_teams: z.boolean().optional(),
})
export type ExperimentalConfig = z.infer<typeof ExperimentalConfigSchema>

View File

@ -19,6 +19,7 @@ import {
createAstGrepTools,
createSessionManagerTools,
createDelegateTask,
createAgentTeamsTools,
discoverCommandsSync,
interactive_bash,
createTaskCreateTool,
@ -117,6 +118,15 @@ export function createToolRegistry(args: {
}
: {}
const agentTeamsEnabled = pluginConfig.experimental?.agent_teams ?? false
const agentTeamsRecord: Record<string, ToolDefinition> = agentTeamsEnabled
? createAgentTeamsTools(managers.backgroundManager, {
client: ctx.client,
userCategories: pluginConfig.categories,
sisyphusJuniorModel: pluginConfig.agents?.["sisyphus-junior"]?.model,
})
: {}
const allTools: Record<string, ToolDefinition> = {
...builtinTools,
...createGrepTools(ctx),
@ -132,6 +142,7 @@ export function createToolRegistry(args: {
slashcommand: slashcommandTool,
interactive_bash,
...taskToolsRecord,
...agentTeamsRecord,
}
const filteredTools = filterDisabledTools(allTools, pluginConfig.disabled_tools)