feat(config): add custom_agents overrides and strict agent validation

This commit is contained in:
edxeth
2026-02-18 19:57:35 +01:00
parent 15519b9580
commit ae12f2e9d2
15 changed files with 1120 additions and 27 deletions

View File

@@ -15,7 +15,9 @@ export async function resolveSubagentExecution(
args: DelegateTaskArgs,
executorCtx: ExecutorContext,
parentAgent: string | undefined,
categoryExamples: string
categoryExamples: string,
inheritedModel?: string,
systemDefaultModel?: string,
): Promise<{ agentToUse: string; categoryModel: { providerID: string; modelID: string; variant?: string } | undefined; fallbackChain?: FallbackEntry[]; error?: string }> {
const { client, agentOverrides } = executorCtx
@@ -123,6 +125,16 @@ Create the work plan directly - that's your job as the planning agent.`,
if (!categoryModel && matchedAgent.model) {
categoryModel = matchedAgent.model
}
if (!categoryModel) {
const fallbackModel = inheritedModel ?? systemDefaultModel
if (fallbackModel) {
const parsedFallback = parseModelString(fallbackModel)
if (parsedFallback) {
categoryModel = parsedFallback
}
}
}
} catch (error) {
const errorMessage = error instanceof Error ? error.message : String(error)
log("[delegate-task] Failed to resolve subagent execution", {