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
@@ -963,4 +963,24 @@ describe("resolveSubagentExecution - agent name sanitization", () => {
expect(result.error).toBeUndefined()
expect(result.agentToUse).toBe("Sisyphus - Ultraworker")
})
test("strips legacy ZWSP-prefixed agent names from persisted subagent runtime state (GH-3259)", async () => {
//#given - persisted runtime agent metadata from v3.14.0-v3.16.0 with ZWSP prefix
readProviderModelsCacheMock.mockReturnValue({
models: {},
connected: [],
updatedAt: "2026-03-03T00:00:00.000Z",
})
const args = createBaseArgs({ subagent_type: "Hephaestus - Deep Agent" })
const executorCtx = createExecutorContext(async () => ([
{ name: "\u200B\u200BHephaestus - Deep Agent", mode: "subagent", model: "openai/gpt-5.3-codex" },
]))
//#when
const result = await resolveSubagentExecution(args, executorCtx, "oracle", "deep")
//#then
expect(result.error).toBeUndefined()
expect(result.agentToUse).toBe("Hephaestus - Deep Agent")
})
})