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
+14
View File
@@ -767,4 +767,18 @@ describe("createChatMessageHandler - TUI variant passthrough", () => {
expect(output.message["model"]).toBeUndefined()
expect(getSessionModel("test-session")).toEqual(nextModel)
})
test("strips legacy ZWSP-prefixed agent names from persisted prompt body session state (GH-3259)", async () => {
//#given - persisted prompt body from v3.14.0-v3.16.0 may contain ZWSP-prefixed agent
const args = createMockHandlerArgs()
const handler = createChatMessageHandler(args)
const input = createMockInput("\u200B\u200BHephaestus - Deep Agent")
const output = createMockOutput()
//#when
await handler(input, output)
//#then
expect(getSessionAgent("test-session")).toBe("Hephaestus - Deep Agent")
})
})