fix(agents): strip ZWSP ordering prefixes in session state, config lookups, and override protection
Prevent ZWSP sort prefixes from leaking into stored agent names, config key lookups, and override-protection normalization. Ensures prefixed list-display names resolve correctly throughout the pipeline. 🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
const PARENTHETICAL_SUFFIX_PATTERN = /\s*(\([^)]*\)\s*)+$/u
|
||||
const ZERO_WIDTH_CHARACTERS_PATTERN = /[\u200B\u200C\u200D\uFEFF]/g
|
||||
|
||||
export function normalizeProtectedAgentName(agentName: string): string {
|
||||
return agentName
|
||||
.replace(ZERO_WIDTH_CHARACTERS_PATTERN, "")
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(PARENTHETICAL_SUFFIX_PATTERN, "")
|
||||
|
||||
Reference in New Issue
Block a user