mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 05:12:55 -07:00
feat(config): add experimental.adk.agentSessionNoninteractiveEnabled setting (#24439)
This commit is contained in:
@@ -1587,6 +1587,11 @@ their corresponding top-level category object in your `settings.json` file.
|
|||||||
|
|
||||||
#### `experimental`
|
#### `experimental`
|
||||||
|
|
||||||
|
- **`experimental.adk.agentSessionNoninteractiveEnabled`** (boolean):
|
||||||
|
- **Description:** Enable non-interactive agent sessions.
|
||||||
|
- **Default:** `false`
|
||||||
|
- **Requires restart:** Yes
|
||||||
|
|
||||||
- **`experimental.enableAgents`** (boolean):
|
- **`experimental.enableAgents`** (boolean):
|
||||||
- **Description:** Enable local and remote subagents.
|
- **Description:** Enable local and remote subagents.
|
||||||
- **Default:** `true`
|
- **Default:** `true`
|
||||||
|
|||||||
@@ -1009,6 +1009,7 @@ export async function loadCliConfig(
|
|||||||
format: (argv.outputFormat ?? settings.output?.format) as OutputFormat,
|
format: (argv.outputFormat ?? settings.output?.format) as OutputFormat,
|
||||||
},
|
},
|
||||||
gemmaModelRouter: settings.experimental?.gemmaModelRouter,
|
gemmaModelRouter: settings.experimental?.gemmaModelRouter,
|
||||||
|
adk: settings.experimental?.adk,
|
||||||
fakeResponses: argv.fakeResponses,
|
fakeResponses: argv.fakeResponses,
|
||||||
recordResponses: argv.recordResponses,
|
recordResponses: argv.recordResponses,
|
||||||
retryFetchErrors: settings.general?.retryFetchErrors,
|
retryFetchErrors: settings.general?.retryFetchErrors,
|
||||||
|
|||||||
@@ -505,6 +505,31 @@ describe('SettingsSchema', () => {
|
|||||||
'The model to use for the classifier. Only tested on `gemma3-1b-gpu-custom`.',
|
'The model to use for the classifier. Only tested on `gemma3-1b-gpu-custom`.',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should have adk setting in schema', () => {
|
||||||
|
const adk = getSettingsSchema().experimental.properties.adk;
|
||||||
|
expect(adk).toBeDefined();
|
||||||
|
expect(adk.type).toBe('object');
|
||||||
|
expect(adk.category).toBe('Experimental');
|
||||||
|
expect(adk.default).toEqual({});
|
||||||
|
expect(adk.requiresRestart).toBe(true);
|
||||||
|
expect(adk.showInDialog).toBe(false);
|
||||||
|
expect(adk.description).toBe(
|
||||||
|
'Settings for the Agent Development Kit (ADK).',
|
||||||
|
);
|
||||||
|
|
||||||
|
const agentSessionNoninteractiveEnabled =
|
||||||
|
adk.properties.agentSessionNoninteractiveEnabled;
|
||||||
|
expect(agentSessionNoninteractiveEnabled).toBeDefined();
|
||||||
|
expect(agentSessionNoninteractiveEnabled.type).toBe('boolean');
|
||||||
|
expect(agentSessionNoninteractiveEnabled.category).toBe('Experimental');
|
||||||
|
expect(agentSessionNoninteractiveEnabled.default).toBe(false);
|
||||||
|
expect(agentSessionNoninteractiveEnabled.requiresRestart).toBe(true);
|
||||||
|
expect(agentSessionNoninteractiveEnabled.showInDialog).toBe(false);
|
||||||
|
expect(agentSessionNoninteractiveEnabled.description).toBe(
|
||||||
|
'Enable non-interactive agent sessions.',
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('has JSON schema definitions for every referenced ref', () => {
|
it('has JSON schema definitions for every referenced ref', () => {
|
||||||
|
|||||||
@@ -1933,6 +1933,26 @@ const SETTINGS_SCHEMA = {
|
|||||||
description: 'Setting to enable experimental features',
|
description: 'Setting to enable experimental features',
|
||||||
showInDialog: false,
|
showInDialog: false,
|
||||||
properties: {
|
properties: {
|
||||||
|
adk: {
|
||||||
|
type: 'object',
|
||||||
|
label: 'ADK',
|
||||||
|
category: 'Experimental',
|
||||||
|
requiresRestart: true,
|
||||||
|
default: {},
|
||||||
|
description: 'Settings for the Agent Development Kit (ADK).',
|
||||||
|
showInDialog: false,
|
||||||
|
properties: {
|
||||||
|
agentSessionNoninteractiveEnabled: {
|
||||||
|
type: 'boolean',
|
||||||
|
label: 'Agent Session Non-interactive Enabled',
|
||||||
|
category: 'Experimental',
|
||||||
|
requiresRestart: true,
|
||||||
|
default: false,
|
||||||
|
description: 'Enable non-interactive agent sessions.',
|
||||||
|
showInDialog: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
enableAgents: {
|
enableAgents: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
label: 'Enable Agents',
|
label: 'Enable Agents',
|
||||||
|
|||||||
@@ -3445,3 +3445,29 @@ describe('ConfigSchema validation', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('ADKSettings', () => {
|
||||||
|
const baseParams: ConfigParameters = {
|
||||||
|
sessionId: 'test',
|
||||||
|
targetDir: '.',
|
||||||
|
debugMode: false,
|
||||||
|
model: 'test-model',
|
||||||
|
cwd: '.',
|
||||||
|
};
|
||||||
|
|
||||||
|
it('should default agentSessionNoninteractiveEnabled to false', () => {
|
||||||
|
const config = new Config(baseParams);
|
||||||
|
expect(config.getAgentSessionNoninteractiveEnabled()).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return provided agentSessionNoninteractiveEnabled', () => {
|
||||||
|
const params: ConfigParameters = {
|
||||||
|
...baseParams,
|
||||||
|
adk: {
|
||||||
|
agentSessionNoninteractiveEnabled: true,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const config = new Config(params);
|
||||||
|
expect(config.getAgentSessionNoninteractiveEnabled()).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -240,6 +240,10 @@ export interface GemmaModelRouterSettings {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ADKSettings {
|
||||||
|
agentSessionNoninteractiveEnabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ExtensionSetting {
|
export interface ExtensionSetting {
|
||||||
name: string;
|
name: string;
|
||||||
description: string;
|
description: string;
|
||||||
@@ -677,6 +681,7 @@ export interface ConfigParameters {
|
|||||||
policyUpdateConfirmationRequest?: PolicyUpdateConfirmationRequest;
|
policyUpdateConfirmationRequest?: PolicyUpdateConfirmationRequest;
|
||||||
output?: OutputSettings;
|
output?: OutputSettings;
|
||||||
gemmaModelRouter?: GemmaModelRouterSettings;
|
gemmaModelRouter?: GemmaModelRouterSettings;
|
||||||
|
adk?: ADKSettings;
|
||||||
disableModelRouterForAuth?: AuthType[];
|
disableModelRouterForAuth?: AuthType[];
|
||||||
continueOnFailedApiCall?: boolean;
|
continueOnFailedApiCall?: boolean;
|
||||||
retryFetchErrors?: boolean;
|
retryFetchErrors?: boolean;
|
||||||
@@ -899,6 +904,7 @@ export class Config implements McpContext, AgentLoopContext {
|
|||||||
private readonly outputSettings: OutputSettings;
|
private readonly outputSettings: OutputSettings;
|
||||||
|
|
||||||
private readonly gemmaModelRouter: GemmaModelRouterSettings;
|
private readonly gemmaModelRouter: GemmaModelRouterSettings;
|
||||||
|
private readonly agentSessionNoninteractiveEnabled: boolean;
|
||||||
|
|
||||||
private readonly continueOnFailedApiCall: boolean;
|
private readonly continueOnFailedApiCall: boolean;
|
||||||
private readonly retryFetchErrors: boolean;
|
private readonly retryFetchErrors: boolean;
|
||||||
@@ -1316,6 +1322,9 @@ export class Config implements McpContext, AgentLoopContext {
|
|||||||
params.gemmaModelRouter?.classifier?.model ?? 'gemma3-1b-gpu-custom',
|
params.gemmaModelRouter?.classifier?.model ?? 'gemma3-1b-gpu-custom',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.agentSessionNoninteractiveEnabled =
|
||||||
|
params.adk?.agentSessionNoninteractiveEnabled ?? false;
|
||||||
this.retryFetchErrors = params.retryFetchErrors ?? true;
|
this.retryFetchErrors = params.retryFetchErrors ?? true;
|
||||||
this.maxAttempts = Math.min(
|
this.maxAttempts = Math.min(
|
||||||
params.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
params.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
||||||
@@ -3367,6 +3376,10 @@ export class Config implements McpContext, AgentLoopContext {
|
|||||||
return this.gemmaModelRouter;
|
return this.gemmaModelRouter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAgentSessionNoninteractiveEnabled(): boolean {
|
||||||
|
return this.agentSessionNoninteractiveEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get override settings for a specific agent.
|
* Get override settings for a specific agent.
|
||||||
* Reads from agents.overrides.<agentName>.
|
* Reads from agents.overrides.<agentName>.
|
||||||
|
|||||||
@@ -2748,6 +2748,23 @@
|
|||||||
"default": {},
|
"default": {},
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"adk": {
|
||||||
|
"title": "ADK",
|
||||||
|
"description": "Settings for the Agent Development Kit (ADK).",
|
||||||
|
"markdownDescription": "Settings for the Agent Development Kit (ADK).\n\n- Category: `Experimental`\n- Requires restart: `yes`\n- Default: `{}`",
|
||||||
|
"default": {},
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"agentSessionNoninteractiveEnabled": {
|
||||||
|
"title": "Agent Session Non-interactive Enabled",
|
||||||
|
"description": "Enable non-interactive agent sessions.",
|
||||||
|
"markdownDescription": "Enable non-interactive agent sessions.\n\n- Category: `Experimental`\n- Requires restart: `yes`\n- Default: `false`",
|
||||||
|
"default": false,
|
||||||
|
"type": "boolean"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"enableAgents": {
|
"enableAgents": {
|
||||||
"title": "Enable Agents",
|
"title": "Enable Agents",
|
||||||
"description": "Enable local and remote subagents.",
|
"description": "Enable local and remote subagents.",
|
||||||
|
|||||||
Reference in New Issue
Block a user