fix: correct merge order so project agents override user agents

Address PR review comment: project agents should take precedence
over user agents when both define the same agent name.
This commit is contained in:
trafgals
2026-04-03 11:51:20 +10:00
parent ad85e43809
commit 2266f28f75
3 changed files with 54 additions and 24 deletions
+2 -2
View File
@@ -92,14 +92,14 @@ Create the work plan directly - that's your job as the planning agent.`,
mergedAgentMap.set(agent.name.toLowerCase(), agent)
}
// Then add user agents (server wins on collision)
// Then add user agents (server/project agents win on collision)
for (const agent of userAgentsList) {
if (!mergedAgentMap.has(agent.name.toLowerCase())) {
mergedAgentMap.set(agent.name.toLowerCase(), agent)
}
}
// Then add project agents (server wins on collision)
// Then add project agents (overrides user agents, server wins on collision)
for (const agent of projectAgentsList) {
if (!mergedAgentMap.has(agent.name.toLowerCase())) {
mergedAgentMap.set(agent.name.toLowerCase(), agent)