This commit is contained in:
Oleg Maslov
2026-09-02 10:14:22 +02:00
parent 0c3e2ead3b
commit b20b138fe4
771 changed files with 161561 additions and 9027 deletions

View File

@@ -9,7 +9,11 @@
*/
import type { TaskShape, TaskShapeType, ComponentPhase } from './task-shape.js';
import type { WorkflowTemplate, WorkflowStep } from './subagent-orchestrator.js';
import {
MAX_WORKFLOW_STEPS,
type WorkflowTemplate,
type WorkflowStep,
} from './subagent-orchestrator.js';
import type { LoadedSkill } from './prompt-loader.js';
import type { WorkflowHarness } from './workflow-harness.js';
import { matchHarness } from './builtin-harnesses.js';
@@ -345,6 +349,14 @@ export function validateTemplate(template: WorkflowTemplate): ValidationError[]
errors.push({ field: 'steps', message: 'At least one step is required' });
return errors;
}
const workerCount = template.steps.length + (template.aggregation === 'synthesize' ? 1 : 0);
if (workerCount > MAX_WORKFLOW_STEPS) {
errors.push({
field: 'steps',
message: `Workflow worker limit exceeded: ${workerCount} > ${MAX_WORKFLOW_STEPS}`,
});
return errors;
}
if (!['concatenate', 'last', 'synthesize'].includes(template.aggregation)) {
errors.push({ field: 'aggregation', message: `Invalid aggregation: ${template.aggregation}` });
}