feat: Add enableSubagents configuration and wire up subagent registration (#9988)

This commit is contained in:
Abhi
2025-10-01 16:54:00 -04:00
committed by GitHub
parent 5b16771567
commit 331ae7dbdf
14 changed files with 352 additions and 39 deletions

View File

@@ -2534,6 +2534,59 @@ describe('loadCliConfig useRipgrep', () => {
expect(config.getUseModelRouter()).toBe(false);
});
});
describe('loadCliConfig enableSubagents', () => {
it('should be false by default when enableSubagents is not set in settings', async () => {
process.argv = ['node', 'script.js'];
const argv = await parseArguments({} as Settings);
const settings: Settings = {};
const config = await loadCliConfig(
settings,
[],
new ExtensionEnablementManager(
ExtensionStorage.getUserExtensionsDir(),
argv.extensions,
),
'test-session',
argv,
);
expect(config.getEnableSubagents()).toBe(false);
});
it('should be true when enableSubagents is set to true in settings', async () => {
process.argv = ['node', 'script.js'];
const argv = await parseArguments({} as Settings);
const settings: Settings = { experimental: { enableSubagents: true } };
const config = await loadCliConfig(
settings,
[],
new ExtensionEnablementManager(
ExtensionStorage.getUserExtensionsDir(),
argv.extensions,
),
'test-session',
argv,
);
expect(config.getEnableSubagents()).toBe(true);
});
it('should be false when enableSubagents is explicitly set to false in settings', async () => {
process.argv = ['node', 'script.js'];
const argv = await parseArguments({} as Settings);
const settings: Settings = { experimental: { enableSubagents: false } };
const config = await loadCliConfig(
settings,
[],
new ExtensionEnablementManager(
ExtensionStorage.getUserExtensionsDir(),
argv.extensions,
),
'test-session',
argv,
);
expect(config.getEnableSubagents()).toBe(false);
});
});
});
describe('screenReader configuration', () => {

View File

@@ -708,6 +708,7 @@ export async function loadCliConfig(
useModelRouter,
enableMessageBusIntegration:
settings.tools?.enableMessageBusIntegration ?? false,
enableSubagents: settings.experimental?.enableSubagents ?? false,
});
}

View File

@@ -330,5 +330,24 @@ describe('SettingsSchema', () => {
getSettingsSchema().experimental.properties.useModelRouter.default,
).toBe(false);
});
it('should have enableSubagents setting in schema', () => {
expect(
getSettingsSchema().experimental.properties.enableSubagents,
).toBeDefined();
expect(
getSettingsSchema().experimental.properties.enableSubagents.type,
).toBe('boolean');
expect(
getSettingsSchema().experimental.properties.enableSubagents.category,
).toBe('Experimental');
expect(
getSettingsSchema().experimental.properties.enableSubagents.default,
).toBe(false);
expect(
getSettingsSchema().experimental.properties.enableSubagents
.requiresRestart,
).toBe(true);
});
});
});

View File

@@ -1001,6 +1001,15 @@ const SETTINGS_SCHEMA = {
'Enable model routing to route requests to the best model based on complexity.',
showInDialog: true,
},
enableSubagents: {
type: 'boolean',
label: 'Enable Subagents',
category: 'Experimental',
requiresRestart: true,
default: false,
description: 'Enable experimental subagents.',
showInDialog: false,
},
},
},