Skip to content

Commit 5611ff4

Browse files
authored
feat(core): add adk.agentSessionSubagentEnabled flag (#26947)
1 parent 77e65c0 commit 5611ff4

5 files changed

Lines changed: 43 additions & 0 deletions

File tree

docs/reference/configuration.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,6 +1854,12 @@ their corresponding top-level category object in your `settings.json` file.
18541854
- **Default:** `false`
18551855
- **Requires restart:** Yes
18561856

1857+
- **`experimental.adk.agentSessionSubagentEnabled`** (boolean):
1858+
- **Description:** Route subagent invocations through the AgentSession
1859+
protocol instead of legacy executors.
1860+
- **Default:** `false`
1861+
- **Requires restart:** Yes
1862+
18571863
- **`experimental.enableAgents`** (boolean):
18581864
- **Description:** Enable local and remote subagents.
18591865
- **Default:** `true`

packages/cli/src/config/settingsSchema.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,18 @@ describe('SettingsSchema', () => {
571571
expect(agentSessionNoninteractiveEnabled.description).toBe(
572572
'Enable non-interactive agent sessions.',
573573
);
574+
575+
const agentSessionSubagentEnabled =
576+
adk.properties.agentSessionSubagentEnabled;
577+
expect(agentSessionSubagentEnabled).toBeDefined();
578+
expect(agentSessionSubagentEnabled.type).toBe('boolean');
579+
expect(agentSessionSubagentEnabled.category).toBe('Experimental');
580+
expect(agentSessionSubagentEnabled.default).toBe(false);
581+
expect(agentSessionSubagentEnabled.requiresRestart).toBe(true);
582+
expect(agentSessionSubagentEnabled.showInDialog).toBe(false);
583+
expect(agentSessionSubagentEnabled.description).toBe(
584+
'Route subagent invocations through the AgentSession protocol instead of legacy executors.',
585+
);
574586
});
575587
});
576588

packages/cli/src/config/settingsSchema.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,6 +2194,16 @@ const SETTINGS_SCHEMA = {
21942194
'Enable the agent session implementation for the interactive CLI.',
21952195
showInDialog: false,
21962196
},
2197+
agentSessionSubagentEnabled: {
2198+
type: 'boolean',
2199+
label: 'Agent Session Subagent Enabled',
2200+
category: 'Experimental',
2201+
requiresRestart: true,
2202+
default: false,
2203+
description:
2204+
'Route subagent invocations through the AgentSession protocol instead of legacy executors.',
2205+
showInDialog: false,
2206+
},
21972207
},
21982208
},
21992209
enableAgents: {

packages/core/src/config/config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ export interface GemmaModelRouterSettings {
237237
export interface ADKSettings {
238238
agentSessionNoninteractiveEnabled?: boolean;
239239
agentSessionInteractiveEnabled?: boolean;
240+
agentSessionSubagentEnabled?: boolean;
240241
}
241242

242243
export interface ExtensionSetting {
@@ -913,6 +914,7 @@ export class Config implements McpContext, AgentLoopContext {
913914
private readonly gemmaModelRouter: GemmaModelRouterSettings;
914915
private readonly agentSessionNoninteractiveEnabled: boolean;
915916
private readonly agentSessionInteractiveEnabled: boolean;
917+
private readonly agentSessionSubagentEnabled: boolean;
916918

917919
private readonly retryFetchErrors: boolean;
918920
private readonly maxAttempts: number;
@@ -1359,6 +1361,8 @@ export class Config implements McpContext, AgentLoopContext {
13591361
params.adk?.agentSessionNoninteractiveEnabled ?? false;
13601362
this.agentSessionInteractiveEnabled =
13611363
params.adk?.agentSessionInteractiveEnabled ?? false;
1364+
this.agentSessionSubagentEnabled =
1365+
params.adk?.agentSessionSubagentEnabled ?? false;
13621366
this.retryFetchErrors = params.retryFetchErrors ?? true;
13631367
this.maxAttempts = Math.min(
13641368
params.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
@@ -2573,6 +2577,10 @@ export class Config implements McpContext, AgentLoopContext {
25732577
return this.contextManagement.enabled;
25742578
}
25752579

2580+
isAgentSessionSubagentEnabled(): boolean {
2581+
return this.agentSessionSubagentEnabled;
2582+
}
2583+
25762584
getMemoryBoundaryMarkers(): readonly string[] {
25772585
return this.memoryBoundaryMarkers;
25782586
}

schemas/settings.schema.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3223,6 +3223,13 @@
32233223
"markdownDescription": "Enable the agent session implementation for the interactive CLI.\n\n- Category: `Experimental`\n- Requires restart: `yes`\n- Default: `false`",
32243224
"default": false,
32253225
"type": "boolean"
3226+
},
3227+
"agentSessionSubagentEnabled": {
3228+
"title": "Agent Session Subagent Enabled",
3229+
"description": "Route subagent invocations through the AgentSession protocol instead of legacy executors.",
3230+
"markdownDescription": "Route subagent invocations through the AgentSession protocol instead of legacy executors.\n\n- Category: `Experimental`\n- Requires restart: `yes`\n- Default: `false`",
3231+
"default": false,
3232+
"type": "boolean"
32263233
}
32273234
},
32283235
"additionalProperties": false

0 commit comments

Comments
 (0)