refactor(agents): drop ZWSP prefixes from agent display names

The sort shim from the previous commit enforces canonical core ordering at runtime, so ZWSP prefixes are no longer needed. Removing them eliminates the Bun.stringWidth vs terminal-width drift that broke the TUI status bar (#3259).

Drop AGENT_LIST_SORT_PREFIXES and getAgentRuntimeName from agent-display-names; switch all call sites to getAgentDisplayName. getAgentListDisplayName stays as a thin alias for external importers.

Keep stripInvisibleAgentCharacters and the ZWSP regex paths so legacy session state and configs from v3.14.0-v3.16.0 still resolve.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-04-27 17:36:05 +09:00
parent dffe5a305b
commit 333ad3aadd
13 changed files with 201 additions and 70 deletions
@@ -247,4 +247,18 @@ describe("claude-code-session-state", () => {
expect(getSessionAgent(sessionID)).toBe(newAgent)
})
})
describe("backward compatibility", () => {
test("strips legacy ZWSP-prefixed agent names from persisted session state (GH-3259)", () => {
// given - persisted session payload from v3.14.0-v3.16.0 with ZWSP prefix
const sessionID = "test-session-legacy-zwsp"
const legacyAgent = "\u200B\u200BHephaestus - Deep Agent"
// when
setSessionAgent(sessionID, legacyAgent)
// then
expect(getSessionAgent(sessionID)).toBe("Hephaestus - Deep Agent")
})
})
})