core: add verification that at least 1 primary agent is enabled, add regression tests (#5881)

This commit is contained in:
Aiden Cline
2025-12-20 19:36:22 -08:00
committed by GitHub
parent cfaac9f2e1
commit d3922f0965
3 changed files with 186 additions and 0 deletions

View File

@@ -262,6 +262,14 @@ export namespace Agent {
}
}
const hasPrimaryAgents = Object.values(result).filter((a) => a.mode !== "subagent" && !a.hidden).length > 0
if (!hasPrimaryAgents) {
throw new Config.InvalidError({
path: "config",
message: "No primary agents are available. Please configure at least one agent with mode 'primary' or 'all'.",
})
}
return result
})