Expose Codebase Investigator settings to the user (#10844)

This commit is contained in:
Silvio Junior
2025-10-13 22:30:32 -04:00
committed by GitHub
parent f56a561f02
commit 9185f68e52
8 changed files with 120 additions and 131 deletions
-53
View File
@@ -2543,59 +2543,6 @@ 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', () => {
+2 -1
View File
@@ -758,7 +758,8 @@ export async function loadCliConfig(
useModelRouter,
enableMessageBusIntegration:
settings.tools?.enableMessageBusIntegration ?? false,
enableSubagents: settings.experimental?.enableSubagents ?? false,
codebaseInvestigatorSettings:
settings.experimental?.codebaseInvestigatorSettings,
});
}
@@ -330,24 +330,5 @@ 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);
});
});
});
+57 -5
View File
@@ -19,6 +19,7 @@ import type {
import {
DEFAULT_TRUNCATE_TOOL_OUTPUT_LINES,
DEFAULT_TRUNCATE_TOOL_OUTPUT_THRESHOLD,
DEFAULT_GEMINI_MODEL,
} from '@google/gemini-cli-core';
import type { CustomTheme } from '../ui/themes/theme.js';
import type { SessionRetentionSettings } from './settings.js';
@@ -1065,14 +1066,65 @@ const SETTINGS_SCHEMA = {
'Enable model routing to route requests to the best model based on complexity.',
showInDialog: true,
},
enableSubagents: {
type: 'boolean',
label: 'Enable Subagents',
codebaseInvestigatorSettings: {
type: 'object',
label: 'Codebase Investigator Settings',
category: 'Experimental',
requiresRestart: true,
default: false,
description: 'Enable experimental subagents.',
default: {},
description: 'Configuration for Codebase Investigator.',
showInDialog: false,
properties: {
enabled: {
type: 'boolean',
label: 'Enable Codebase Investigator',
category: 'Experimental',
requiresRestart: true,
default: false,
description: 'Enable the Codebase Investigator agent.',
showInDialog: true,
},
maxNumTurns: {
type: 'number',
label: 'Codebase Investigator Max Num Turns',
category: 'Experimental',
requiresRestart: true,
default: 15,
description:
'Maximum number of turns for the Codebase Investigator agent.',
showInDialog: true,
},
maxTimeMinutes: {
type: 'number',
label: 'Max Time (Minutes)',
category: 'Experimental',
requiresRestart: true,
default: 5,
description:
'Maximum time for the Codebase Investigator agent (in minutes).',
showInDialog: false,
},
thinkingBudget: {
type: 'number',
label: 'Thinking Budget',
category: 'Experimental',
requiresRestart: true,
default: -1,
description:
'The thinking budget for the Codebase Investigator agent.',
showInDialog: false,
},
model: {
type: 'string',
label: 'Model',
category: 'Experimental',
requiresRestart: true,
default: DEFAULT_GEMINI_MODEL,
description:
'The model to use for the Codebase Investigator agent.',
showInDialog: false,
},
},
},
},
},
@@ -342,7 +342,7 @@ describe('SettingsDialog', () => {
await wait();
expect(lastFrame()).toContain('● Use Model Router');
expect(lastFrame()).toContain('● Codebase Investigator Max Num Turns');
unmount();
});