Merge pull request #3657 from code-yeongyu/refactor/replace-zwsp-with-real-spaces

refactor(agents): replace broken ZWSP sort prefixes with leading ASCII spaces
This commit is contained in:
YeonGyu-Kim
2026-04-27 15:36:51 +09:00
committed by GitHub
6 changed files with 213 additions and 35 deletions
@@ -18,12 +18,16 @@ const registeredAgentAliases = new Map<string, string>()
const ZERO_WIDTH_CHARACTERS_REGEX = /[\u200B\u200C\u200D\uFEFF]/g
function stripSortPrefix(name: string): string {
return name.replace(ZERO_WIDTH_CHARACTERS_REGEX, "").replace(/^\s+/, "")
}
function normalizeRegisteredAgentName(name: string): string {
return name.replace(ZERO_WIDTH_CHARACTERS_REGEX, "").toLowerCase()
return stripSortPrefix(name).toLowerCase()
}
function normalizeStoredAgentName(name: string): string {
return name.replace(ZERO_WIDTH_CHARACTERS_REGEX, "")
return stripSortPrefix(name)
}
export function registerAgentName(name: string): void {