Merge pull request #3330 from codeg-dev/fix/isplan-display-name-getAgentConfigKey
fix(delegate-task): apply getAgentConfigKey normalization to isPlanAgent
This commit is contained in:
@@ -326,7 +326,7 @@ export const PLAN_AGENT_NAMES = ["plan"]
|
|||||||
*/
|
*/
|
||||||
export function isPlanAgent(agentName: string | undefined): boolean {
|
export function isPlanAgent(agentName: string | undefined): boolean {
|
||||||
if (!agentName) return false
|
if (!agentName) return false
|
||||||
const lowerName = agentName.toLowerCase().trim()
|
const lowerName = getAgentConfigKey(agentName).toLowerCase().trim()
|
||||||
return PLAN_AGENT_NAMES.some(name => lowerName === name)
|
return PLAN_AGENT_NAMES.some(name => lowerName === name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ describe("sisyphus-task", () => {
|
|||||||
expect(result).toBe(false)
|
expect(result).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("returns true for 'planner' (matches via includes('plan'))", () => {
|
test("returns false for 'planner' (no longer matches via substring)", () => {
|
||||||
//#given / #when
|
//#given / #when
|
||||||
const result = isPlanAgent("planner")
|
const result = isPlanAgent("planner")
|
||||||
|
|
||||||
@@ -252,6 +252,13 @@ describe("sisyphus-task", () => {
|
|||||||
//#given / #when / #then
|
//#given / #when / #then
|
||||||
expect(PLAN_AGENT_NAMES).toEqual(["plan"])
|
expect(PLAN_AGENT_NAMES).toEqual(["plan"])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("returns false for non-plan agent display names (regression: isPlanAgent display-name false-positive)", () => {
|
||||||
|
//#given / #when / #then
|
||||||
|
expect(isPlanAgent(getAgentDisplayName("metis"))).toBe(false)
|
||||||
|
expect(isPlanAgent(getAgentDisplayName("momus"))).toBe(false)
|
||||||
|
expect(isPlanAgent(getAgentDisplayName("atlas"))).toBe(false)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("isPlanFamily", () => {
|
describe("isPlanFamily", () => {
|
||||||
@@ -318,6 +325,13 @@ describe("sisyphus-task", () => {
|
|||||||
expect(result).toBe(false)
|
expect(result).toBe(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("returns false for non-plan-family agent display names (regression: isPlanFamily includes() false-positive)", () => {
|
||||||
|
//#given / #when / #then
|
||||||
|
expect(isPlanFamily(getAgentDisplayName("metis"))).toBe(false)
|
||||||
|
expect(isPlanFamily(getAgentDisplayName("momus"))).toBe(false)
|
||||||
|
expect(isPlanFamily(getAgentDisplayName("atlas"))).toBe(false)
|
||||||
|
})
|
||||||
|
|
||||||
test("PLAN_FAMILY_NAMES contains plan and prometheus", () => {
|
test("PLAN_FAMILY_NAMES contains plan and prometheus", () => {
|
||||||
//#given / #when / #then
|
//#given / #when / #then
|
||||||
expect(PLAN_FAMILY_NAMES).toEqual(["plan", "prometheus"])
|
expect(PLAN_FAMILY_NAMES).toEqual(["plan", "prometheus"])
|
||||||
|
|||||||
Reference in New Issue
Block a user