fix(zwsp): strip zero-width chars in start-work-hook
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -14,6 +14,7 @@ import { log } from "../../shared/logger"
|
|||||||
import {
|
import {
|
||||||
getAgentDisplayName,
|
getAgentDisplayName,
|
||||||
getAgentListDisplayName,
|
getAgentListDisplayName,
|
||||||
|
stripAgentListSortPrefix,
|
||||||
} from "../../shared/agent-display-names"
|
} from "../../shared/agent-display-names"
|
||||||
import {
|
import {
|
||||||
isAgentRegistered,
|
isAgentRegistered,
|
||||||
@@ -90,7 +91,7 @@ export function createStartWorkHook(ctx: PluginInput) {
|
|||||||
: getAgentDisplayName(activeAgent)
|
: getAgentDisplayName(activeAgent)
|
||||||
updateSessionAgent(input.sessionID, activeAgent)
|
updateSessionAgent(input.sessionID, activeAgent)
|
||||||
if (output.message) {
|
if (output.message) {
|
||||||
output.message["agent"] = activeAgentDisplayName
|
output.message["agent"] = stripAgentListSortPrefix(activeAgentDisplayName)
|
||||||
}
|
}
|
||||||
|
|
||||||
const existingState = readBoulderState(ctx.directory)
|
const existingState = readBoulderState(ctx.directory)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ const AGENT_LIST_SORT_PREFIXES: Record<string, string> = {
|
|||||||
atlas: "\u200B\u200B\u200B\u200B",
|
atlas: "\u200B\u200B\u200B\u200B",
|
||||||
}
|
}
|
||||||
|
|
||||||
function stripAgentListSortPrefix(agentName: string): string {
|
export function stripAgentListSortPrefix(agentName: string): string {
|
||||||
return agentName.replace(/^\u200B+/, "")
|
return agentName.replace(/^\u200B+/, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user