feat(agents): add ZWSP stable-sort prefixes for core agent list ordering

Populate AGENT_LIST_SORT_PREFIXES for sisyphus/hephaestus/prometheus/atlas
so the TUI agent list renders in canonical order. Update dependent tests
to use getAgentListDisplayName() instead of hardcoded display strings.

🤖 Generated with [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) assistance
This commit is contained in:
YeonGyu-Kim
2026-04-06 18:07:07 +09:00
parent 88280d0e4d
commit 178b635d72
5 changed files with 45 additions and 33 deletions
+11 -5
View File
@@ -181,17 +181,23 @@ describe("getAgentConfigKey", () => {
})
describe("getAgentListDisplayName", () => {
it("keeps sisyphus unchanged for list display", () => {
expect(getAgentListDisplayName("sisyphus")).toBe("Sisyphus (Ultraworker)")
it("applies invisible stable-sort prefixes to the core agent list", () => {
expect(getAgentListDisplayName("sisyphus")).toBe("\u200BSisyphus (Ultraworker)")
expect(getAgentListDisplayName("hephaestus")).toBe("\u200B\u200BHephaestus (Deep Agent)")
expect(getAgentListDisplayName("prometheus")).toBe("\u200B\u200B\u200BPrometheus (Plan Builder)")
expect(getAgentListDisplayName("atlas")).toBe("\u200B\u200B\u200B\u200BAtlas (Plan Executor)")
})
it("returns atlas display name without sort prefix", () => {
expect(getAgentListDisplayName("atlas")).toBe("Atlas (Plan Executor)")
it("keeps non-core agents unprefixed for list display", () => {
expect(getAgentListDisplayName("oracle")).toBe("oracle")
})
})
describe("normalizeAgentForPrompt", () => {
it("strips atlas UI ordering prefix back to canonical display name", () => {
it("strips core UI ordering prefixes back to canonical display names", () => {
expect(normalizeAgentForPrompt(getAgentListDisplayName("sisyphus"))).toBe("Sisyphus (Ultraworker)")
expect(normalizeAgentForPrompt(getAgentListDisplayName("hephaestus"))).toBe("Hephaestus (Deep Agent)")
expect(normalizeAgentForPrompt(getAgentListDisplayName("prometheus"))).toBe("Prometheus (Plan Builder)")
expect(normalizeAgentForPrompt(getAgentListDisplayName("atlas"))).toBe("Atlas (Plan Executor)")
})
})
+6 -1
View File
@@ -20,7 +20,12 @@ export const AGENT_DISPLAY_NAMES: Record<string, string> = {
"council-member": "council-member",
}
const AGENT_LIST_SORT_PREFIXES: Record<string, string> = {}
const AGENT_LIST_SORT_PREFIXES: Record<string, string> = {
sisyphus: "\u200B",
hephaestus: "\u200B\u200B",
prometheus: "\u200B\u200B\u200B",
atlas: "\u200B\u200B\u200B\u200B",
}
function stripAgentListSortPrefix(agentName: string): string {
return agentName.replace(/^\u200B+/, "")