feat: subagent model defaults

This commit is contained in:
Peter Steinberger
2026-01-12 18:08:16 +00:00
parent 17ff25bd20
commit 7b93356fb7
7 changed files with 141 additions and 4 deletions

View File

@@ -1090,6 +1090,8 @@ export type ToolsConfig = {
};
/** Sub-agent tool policy defaults (deny wins). */
subagents?: {
/** Default model selection for spawned sub-agents (string or {primary,fallbacks}). */
model?: string | { primary?: string; fallbacks?: string[] };
tools?: {
allow?: string[];
deny?: string[];
@@ -1119,6 +1121,8 @@ export type AgentConfig = {
subagents?: {
/** Allow spawning sub-agents under other agent ids. Use "*" to allow any. */
allowAgents?: string[];
/** Per-agent default model for spawned sub-agents (string or {primary,fallbacks}). */
model?: string | { primary?: string; fallbacks?: string[] };
};
sandbox?: {
mode?: "off" | "non-main" | "all";

View File

@@ -924,6 +924,15 @@ const AgentEntrySchema = z.object({
subagents: z
.object({
allowAgents: z.array(z.string()).optional(),
model: z
.union([
z.string(),
z.object({
primary: z.string().optional(),
fallbacks: z.array(z.string()).optional(),
}),
])
.optional(),
})
.optional(),
sandbox: AgentSandboxSchema,
@@ -1227,6 +1236,15 @@ const AgentDefaultsSchema = z
.object({
maxConcurrent: z.number().int().positive().optional(),
archiveAfterMinutes: z.number().int().positive().optional(),
model: z
.union([
z.string(),
z.object({
primary: z.string().optional(),
fallbacks: z.array(z.string()).optional(),
}),
])
.optional(),
})
.optional(),
sandbox: z