feat: enable subagents (#22386)

This commit is contained in:
Abhi
2026-03-16 14:40:12 -04:00
committed by GitHub
parent 56e0865a7b
commit d43ec6c8f3
13 changed files with 111 additions and 59 deletions

View File

@@ -137,6 +137,7 @@ describe('handleInstall', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
securityWarnings: [],
discoveryErrors: [],
@@ -379,6 +380,7 @@ describe('handleInstall', () => {
mcps: [],
hooks: [],
skills: ['cool-skill'],
agents: ['cool-agent'],
settings: [],
securityWarnings: ['Security risk!'],
discoveryErrors: ['Read error'],
@@ -408,6 +410,10 @@ describe('handleInstall', () => {
expect.stringContaining('cool-skill'),
false,
);
expect(mockPromptForConsentNonInteractive).toHaveBeenCalledWith(
expect.stringContaining('cool-agent'),
false,
);
expect(mockPromptForConsentNonInteractive).toHaveBeenCalledWith(
expect.stringContaining('Security Warnings:'),
false,

View File

@@ -99,11 +99,15 @@ export async function handleInstall(args: InstallArgs) {
if (hasDiscovery) {
promptLines.push(chalk.bold('This folder contains:'));
const groups = [
{ label: 'Commands', items: discoveryResults.commands },
{ label: 'MCP Servers', items: discoveryResults.mcps },
{ label: 'Hooks', items: discoveryResults.hooks },
{ label: 'Skills', items: discoveryResults.skills },
{ label: 'Setting overrides', items: discoveryResults.settings },
{ label: 'Commands', items: discoveryResults.commands ?? [] },
{ label: 'MCP Servers', items: discoveryResults.mcps ?? [] },
{ label: 'Hooks', items: discoveryResults.hooks ?? [] },
{ label: 'Skills', items: discoveryResults.skills ?? [] },
{ label: 'Agents', items: discoveryResults.agents ?? [] },
{
label: 'Setting overrides',
items: discoveryResults.settings ?? [],
},
].filter((g) => g.items.length > 0);
for (const group of groups) {

View File

@@ -400,12 +400,10 @@ describe('SettingsSchema', () => {
expect(setting).toBeDefined();
expect(setting.type).toBe('boolean');
expect(setting.category).toBe('Experimental');
expect(setting.default).toBe(false);
expect(setting.default).toBe(true);
expect(setting.requiresRestart).toBe(true);
expect(setting.showInDialog).toBe(false);
expect(setting.description).toBe(
'Enable local and remote subagents. Warning: Experimental feature, uses YOLO mode for subagents',
);
expect(setting.description).toBe('Enable local and remote subagents.');
});
it('should have skills setting enabled by default', () => {

View File

@@ -1838,9 +1838,8 @@ const SETTINGS_SCHEMA = {
label: 'Enable Agents',
category: 'Experimental',
requiresRestart: true,
default: false,
description:
'Enable local and remote subagents. Warning: Experimental feature, uses YOLO mode for subagents',
default: true,
description: 'Enable local and remote subagents.',
showInDialog: false,
},
extensionManagement: {

View File

@@ -66,6 +66,7 @@ describe('FolderTrustDialog', () => {
mcps: Array.from({ length: 10 }, (_, i) => `mcp${i}`),
hooks: Array.from({ length: 10 }, (_, i) => `hook${i}`),
skills: Array.from({ length: 10 }, (_, i) => `skill${i}`),
agents: [],
settings: Array.from({ length: 10 }, (_, i) => `setting${i}`),
discoveryErrors: [],
securityWarnings: [],
@@ -95,6 +96,7 @@ describe('FolderTrustDialog', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
discoveryErrors: [],
securityWarnings: [],
@@ -125,6 +127,7 @@ describe('FolderTrustDialog', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
discoveryErrors: [],
securityWarnings: [],
@@ -152,6 +155,7 @@ describe('FolderTrustDialog', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
discoveryErrors: [],
securityWarnings: [],
@@ -332,6 +336,7 @@ describe('FolderTrustDialog', () => {
mcps: ['mcp1'],
hooks: ['hook1'],
skills: ['skill1'],
agents: ['agent1'],
settings: ['general', 'ui'],
discoveryErrors: [],
securityWarnings: [],
@@ -355,6 +360,8 @@ describe('FolderTrustDialog', () => {
expect(lastFrame()).toContain('- hook1');
expect(lastFrame()).toContain('• Skills (1):');
expect(lastFrame()).toContain('- skill1');
expect(lastFrame()).toContain('• Agents (1):');
expect(lastFrame()).toContain('- agent1');
expect(lastFrame()).toContain('• Setting overrides (2):');
expect(lastFrame()).toContain('- general');
expect(lastFrame()).toContain('- ui');
@@ -367,6 +374,7 @@ describe('FolderTrustDialog', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
discoveryErrors: [],
securityWarnings: ['Dangerous setting detected!'],
@@ -390,6 +398,7 @@ describe('FolderTrustDialog', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
discoveryErrors: ['Failed to load custom commands'],
securityWarnings: [],
@@ -413,6 +422,7 @@ describe('FolderTrustDialog', () => {
mcps: [],
hooks: [],
skills: [],
agents: [],
settings: [],
discoveryErrors: [],
securityWarnings: [],
@@ -446,6 +456,7 @@ describe('FolderTrustDialog', () => {
mcps: [`${ansiRed}mcp-with-ansi${ansiReset}`],
hooks: [`${ansiRed}hook-with-ansi${ansiReset}`],
skills: [`${ansiRed}skill-with-ansi${ansiReset}`],
agents: [],
settings: [`${ansiRed}setting-with-ansi${ansiReset}`],
discoveryErrors: [`${ansiRed}error-with-ansi${ansiReset}`],
securityWarnings: [`${ansiRed}warning-with-ansi${ansiReset}`],

View File

@@ -135,6 +135,7 @@ export const FolderTrustDialog: React.FC<FolderTrustDialogProps> = ({
{ label: 'MCP Servers', items: discoveryResults?.mcps ?? [] },
{ label: 'Hooks', items: discoveryResults?.hooks ?? [] },
{ label: 'Skills', items: discoveryResults?.skills ?? [] },
{ label: 'Agents', items: discoveryResults?.agents ?? [] },
{ label: 'Setting overrides', items: discoveryResults?.settings ?? [] },
].filter((g) => g.items.length > 0);