mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 20:14:44 -07:00
feat(core): Remove legacy settings. (#17244)
This commit is contained in:
@@ -941,10 +941,14 @@ describe('Server Config (config.ts)', () => {
|
||||
expect(wasReadFileToolRegistered).toBe(false);
|
||||
});
|
||||
|
||||
it('should register subagents as tools when codebaseInvestigatorSettings.enabled is true', async () => {
|
||||
it('should register subagents as tools when agents.overrides.codebase_investigator.enabled is true', async () => {
|
||||
const params: ConfigParameters = {
|
||||
...baseParams,
|
||||
codebaseInvestigatorSettings: { enabled: true },
|
||||
agents: {
|
||||
overrides: {
|
||||
codebase_investigator: { enabled: true },
|
||||
},
|
||||
},
|
||||
};
|
||||
const config = new Config(params);
|
||||
|
||||
@@ -991,11 +995,15 @@ describe('Server Config (config.ts)', () => {
|
||||
expect(registeredWrappers).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('should not register subagents as tools when codebaseInvestigatorSettings.enabled is false', async () => {
|
||||
it('should not register subagents as tools when agents are disabled', async () => {
|
||||
const params: ConfigParameters = {
|
||||
...baseParams,
|
||||
codebaseInvestigatorSettings: { enabled: false },
|
||||
cliHelpAgentSettings: { enabled: false },
|
||||
agents: {
|
||||
overrides: {
|
||||
codebase_investigator: { enabled: false },
|
||||
cli_help: { enabled: false },
|
||||
},
|
||||
},
|
||||
};
|
||||
const config = new Config(params);
|
||||
|
||||
@@ -1010,11 +1018,6 @@ describe('Server Config (config.ts)', () => {
|
||||
expect(DelegateToAgentToolMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should not set default codebase investigator model in config (defaults in registry)', () => {
|
||||
const config = new Config(baseParams);
|
||||
expect(config.getCodebaseInvestigatorSettings()?.model).toBeUndefined();
|
||||
});
|
||||
|
||||
describe('with minified tool class names', () => {
|
||||
beforeEach(() => {
|
||||
Object.defineProperty(
|
||||
|
||||
@@ -49,7 +49,6 @@ import {
|
||||
DEFAULT_GEMINI_EMBEDDING_MODEL,
|
||||
DEFAULT_GEMINI_FLASH_MODEL,
|
||||
DEFAULT_GEMINI_MODEL_AUTO,
|
||||
DEFAULT_THINKING_MODE,
|
||||
isPreviewModel,
|
||||
PREVIEW_GEMINI_MODEL,
|
||||
PREVIEW_GEMINI_MODEL_AUTO,
|
||||
@@ -144,14 +143,6 @@ export interface OutputSettings {
|
||||
format?: OutputFormat;
|
||||
}
|
||||
|
||||
export interface CodebaseInvestigatorSettings {
|
||||
enabled?: boolean;
|
||||
maxNumTurns?: number;
|
||||
maxTimeMinutes?: number;
|
||||
thinkingBudget?: number;
|
||||
model?: string;
|
||||
}
|
||||
|
||||
export interface ExtensionSetting {
|
||||
name: string;
|
||||
description: string;
|
||||
@@ -168,10 +159,6 @@ export interface ResolvedExtensionSetting {
|
||||
source?: string;
|
||||
}
|
||||
|
||||
export interface CliHelpAgentSettings {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export interface AgentRunConfig {
|
||||
maxTimeMinutes?: number;
|
||||
maxTurns?: number;
|
||||
@@ -368,8 +355,6 @@ export interface ConfigParameters {
|
||||
policyEngineConfig?: PolicyEngineConfig;
|
||||
output?: OutputSettings;
|
||||
disableModelRouterForAuth?: AuthType[];
|
||||
codebaseInvestigatorSettings?: CodebaseInvestigatorSettings;
|
||||
cliHelpAgentSettings?: CliHelpAgentSettings;
|
||||
continueOnFailedApiCall?: boolean;
|
||||
retryFetchErrors?: boolean;
|
||||
enableShellOutputEfficiency?: boolean;
|
||||
@@ -513,8 +498,6 @@ export class Config {
|
||||
private readonly messageBus: MessageBus;
|
||||
private readonly policyEngine: PolicyEngine;
|
||||
private readonly outputSettings: OutputSettings;
|
||||
private readonly codebaseInvestigatorSettings: CodebaseInvestigatorSettings;
|
||||
private readonly cliHelpAgentSettings: CliHelpAgentSettings;
|
||||
private readonly continueOnFailedApiCall: boolean;
|
||||
private readonly retryFetchErrors: boolean;
|
||||
private readonly enableShellOutputEfficiency: boolean;
|
||||
@@ -688,18 +671,6 @@ export class Config {
|
||||
this.enableHooks = params.enableHooks ?? true;
|
||||
this.disabledHooks = params.disabledHooks ?? [];
|
||||
|
||||
this.codebaseInvestigatorSettings = {
|
||||
enabled: params.codebaseInvestigatorSettings?.enabled ?? true,
|
||||
maxNumTurns: params.codebaseInvestigatorSettings?.maxNumTurns ?? 10,
|
||||
maxTimeMinutes: params.codebaseInvestigatorSettings?.maxTimeMinutes ?? 3,
|
||||
thinkingBudget:
|
||||
params.codebaseInvestigatorSettings?.thinkingBudget ??
|
||||
DEFAULT_THINKING_MODE,
|
||||
model: params.codebaseInvestigatorSettings?.model,
|
||||
};
|
||||
this.cliHelpAgentSettings = {
|
||||
enabled: params.cliHelpAgentSettings?.enabled ?? true,
|
||||
};
|
||||
this.continueOnFailedApiCall = params.continueOnFailedApiCall ?? true;
|
||||
this.enableShellOutputEfficiency =
|
||||
params.enableShellOutputEfficiency ?? true;
|
||||
@@ -1895,14 +1866,6 @@ export class Config {
|
||||
return this.enableHooksUI;
|
||||
}
|
||||
|
||||
getCodebaseInvestigatorSettings(): CodebaseInvestigatorSettings {
|
||||
return this.codebaseInvestigatorSettings;
|
||||
}
|
||||
|
||||
getCliHelpAgentSettings(): CliHelpAgentSettings {
|
||||
return this.cliHelpAgentSettings;
|
||||
}
|
||||
|
||||
async createToolRegistry(): Promise<ToolRegistry> {
|
||||
const registry = new ToolRegistry(this, this.messageBus);
|
||||
|
||||
@@ -1980,10 +1943,11 @@ export class Config {
|
||||
* Registers the DelegateToAgentTool if agents or related features are enabled.
|
||||
*/
|
||||
private registerDelegateToAgentTool(registry: ToolRegistry): void {
|
||||
const agentsOverrides = this.getAgentsSettings().overrides ?? {};
|
||||
if (
|
||||
this.isAgentsEnabled() ||
|
||||
this.getCodebaseInvestigatorSettings().enabled ||
|
||||
this.getCliHelpAgentSettings().enabled
|
||||
agentsOverrides['codebase_investigator']?.enabled !== false ||
|
||||
agentsOverrides['cli_help']?.enabled !== false
|
||||
) {
|
||||
// Check if the delegate tool itself is allowed (if allowedTools is set)
|
||||
const allowedTools = this.getAllowedTools();
|
||||
|
||||
Reference in New Issue
Block a user