Fix invisible characters in agent names

This commit is contained in:
YeonGyu-Kim
2026-04-11 20:44:57 +09:00
parent bbec1883fd
commit a442976d77
4 changed files with 55 additions and 4 deletions
+9
View File
@@ -186,6 +186,11 @@ describe("getAgentConfigKey", () => {
it("resolves atlas even when the UI ordering prefix is present", () => {
expect(getAgentConfigKey(getAgentListDisplayName("atlas"))).toBe("atlas")
})
it("resolves display names even when zero-width characters are embedded", () => {
expect(getAgentConfigKey("Sisyphus\u200B - Ultraworker")).toBe("sisyphus")
expect(getAgentConfigKey("\uFEFFAtlas - Plan Executor")).toBe("atlas")
})
})
describe("getAgentListDisplayName", () => {
@@ -208,6 +213,10 @@ describe("normalizeAgentForPrompt", () => {
expect(normalizeAgentForPrompt(getAgentListDisplayName("prometheus"))).toBe("Prometheus - Plan Builder")
expect(normalizeAgentForPrompt(getAgentListDisplayName("atlas"))).toBe("Atlas - Plan Executor")
})
it("removes zero-width characters before returning canonical names", () => {
expect(normalizeAgentForPrompt("Sisyphus\u200B - Ultraworker")).toBe("Sisyphus - Ultraworker")
})
})
describe("normalizeAgentForPromptKey", () => {