feat(core): add default execution limits for subagents (#18274)

This commit is contained in:
Abhi
2026-02-04 01:28:00 -05:00
committed by GitHub
parent 94f4e5cc15
commit b39cefe14e
5 changed files with 47 additions and 19 deletions
+7 -3
View File
@@ -10,7 +10,11 @@ import { type Dirent } from 'node:fs';
import * as path from 'node:path';
import * as crypto from 'node:crypto';
import { z } from 'zod';
import type { AgentDefinition } from './types.js';
import {
type AgentDefinition,
DEFAULT_MAX_TURNS,
DEFAULT_MAX_TIME_MINUTES,
} from './types.js';
import { isValidToolName } from '../tools/tool-names.js';
import { FRONTMATTER_REGEX } from '../skills/skillLoader.js';
import { getErrorMessage } from '../utils/errors.js';
@@ -290,8 +294,8 @@ export function markdownToAgentDefinition(
},
},
runConfig: {
maxTurns: markdown.max_turns,
maxTimeMinutes: markdown.timeout_mins || 5,
maxTurns: markdown.max_turns ?? DEFAULT_MAX_TURNS,
maxTimeMinutes: markdown.timeout_mins ?? DEFAULT_MAX_TIME_MINUTES,
},
toolConfig: markdown.tools
? {