feat(core, cli): Add support for agents in settings.json. (#16433)

This commit is contained in:
joshualitt
2026-01-13 12:16:02 -08:00
committed by GitHub
parent e931ebe581
commit 92e31e3c4a
8 changed files with 382 additions and 56 deletions

View File

@@ -660,6 +660,7 @@ export async function loadCliConfig(
mcpServers: mcpEnabled ? settings.mcpServers : {},
mcpEnabled,
extensionsEnabled,
agents: settings.agents,
allowedMcpServers: mcpEnabled
? (argv.allowedMcpServerNames ?? settings.mcp?.allowed)
: undefined,

View File

@@ -785,6 +785,32 @@ const SETTINGS_SCHEMA = {
},
},
agents: {
type: 'object',
label: 'Agents',
category: 'Advanced',
requiresRestart: true,
default: {},
description: 'Settings for subagents.',
showInDialog: false,
properties: {
overrides: {
type: 'object',
label: 'Agent Overrides',
category: 'Advanced',
requiresRestart: true,
default: {},
description:
'Override settings for specific agents, e.g. to disable the agent, set a custom model config, or run config.',
showInDialog: false,
additionalProperties: {
type: 'object',
ref: 'AgentOverride',
},
},
},
},
context: {
type: 'object',
label: 'Context',
@@ -2002,6 +2028,36 @@ export const SETTINGS_SCHEMA_DEFINITIONS: Record<
},
},
},
AgentOverride: {
type: 'object',
description: 'Override settings for a specific agent.',
additionalProperties: false,
properties: {
modelConfig: {
type: 'object',
additionalProperties: true,
},
runConfig: {
type: 'object',
description: 'Run configuration for an agent.',
additionalProperties: false,
properties: {
maxTimeMinutes: {
type: 'number',
description: 'The maximum execution time for the agent in minutes.',
},
maxTurns: {
type: 'number',
description: 'The maximum number of conversational turns.',
},
},
},
disabled: {
type: 'boolean',
description: 'Whether to disable the agent.',
},
},
},
CustomTheme: {
type: 'object',
description: