fix: add isPlanFamily for prometheus↔plan mutual blocking and task permission

- PLAN_AGENT_NAMES = ['plan'] (system prompt only)
- PLAN_FAMILY_NAMES = ['plan', 'prometheus'] (blocking + task permission)
- prometheus↔plan mutual delegation blocked via isPlanFamily()
- prometheus gets task tool permission via isPlanFamily()
- prompt-builder unchanged: prometheus does NOT get plan system prompt
This commit is contained in:
YeonGyu-Kim
2026-02-08 16:48:52 +09:00
parent f2b7b759c8
commit bb86523240
3 changed files with 148 additions and 182 deletions
+18 -5
View File
@@ -535,18 +535,31 @@ export function buildPlanAgentSystemPrepend(
}
/**
* List of agent names that should be treated as plan agents.
* List of agent names that should be treated as plan agents (receive plan system prompt).
* Case-insensitive matching is used.
*/
export const PLAN_AGENT_NAMES = ["plan", "planner"]
export const PLAN_AGENT_NAMES = ["plan"]
/**
* Check if the given agent name is a plan agent.
* @param agentName - The agent name to check
* @returns true if the agent is a plan agent
* Check if the given agent name is a plan agent (receives plan system prompt).
*/
export function isPlanAgent(agentName: string | undefined): boolean {
if (!agentName) return false
const lowerName = agentName.toLowerCase().trim()
return PLAN_AGENT_NAMES.some(name => lowerName === name || lowerName.includes(name))
}
/**
* Plan family: plan + prometheus. Shares mutual delegation blocking and task tool permission.
* Does NOT share system prompt (only isPlanAgent controls that).
*/
export const PLAN_FAMILY_NAMES = ["plan", "prometheus"]
/**
* Check if the given agent belongs to the plan family (blocking + task permission).
*/
export function isPlanFamily(agentName: string | undefined): boolean {
if (!agentName) return false
const lowerName = agentName.toLowerCase().trim()
return PLAN_FAMILY_NAMES.some(name => lowerName === name || lowerName.includes(name))
}