Revert "Merge pull request #3657 from code-yeongyu/refactor/replace-zwsp-with-real-spaces"

This reverts commit f1a11f2c92, reversing
changes made to 62c19ce0ef.
This commit is contained in:
YeonGyu-Kim
2026-04-27 15:53:46 +09:00
parent 9823462994
commit 1da7df1aee
6 changed files with 35 additions and 213 deletions
+6 -19
View File
@@ -1,5 +1,5 @@
import { describe, it, expect } from "bun:test"
import { AGENT_DISPLAY_NAMES, getAgentConfigKey, getAgentDisplayName, getAgentListDisplayName, getAgentRuntimeName, normalizeAgentForPrompt, normalizeAgentForPromptKey } from "./agent-display-names"
import { AGENT_DISPLAY_NAMES, getAgentConfigKey, getAgentDisplayName, getAgentListDisplayName, normalizeAgentForPrompt, normalizeAgentForPromptKey } from "./agent-display-names"
describe("getAgentDisplayName", () => {
it("returns display name for lowercase config key (new format)", () => {
@@ -194,11 +194,11 @@ describe("getAgentConfigKey", () => {
})
describe("getAgentListDisplayName", () => {
it("returns clean display names for object keys (no leading whitespace, RFC 7230 safe)", () => {
expect(getAgentListDisplayName("sisyphus")).toBe("Sisyphus - Ultraworker")
expect(getAgentListDisplayName("hephaestus")).toBe("Hephaestus - Deep Agent")
expect(getAgentListDisplayName("prometheus")).toBe("Prometheus - Plan Builder")
expect(getAgentListDisplayName("atlas")).toBe("Atlas - Plan Executor")
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("keeps non-core agents unprefixed for list display", () => {
@@ -206,19 +206,6 @@ describe("getAgentListDisplayName", () => {
})
})
describe("getAgentRuntimeName", () => {
it("applies leading-space stable-sort prefixes so OpenCode localeCompare yields canonical order", () => {
expect(getAgentRuntimeName("sisyphus")).toBe(" Sisyphus - Ultraworker")
expect(getAgentRuntimeName("hephaestus")).toBe(" Hephaestus - Deep Agent")
expect(getAgentRuntimeName("prometheus")).toBe(" Prometheus - Plan Builder")
expect(getAgentRuntimeName("atlas")).toBe(" Atlas - Plan Executor")
})
it("keeps non-core agents unprefixed (no entry in AGENT_LIST_SORT_PREFIXES)", () => {
expect(getAgentRuntimeName("oracle")).toBe("oracle")
})
})
describe("normalizeAgentForPrompt", () => {
it("strips core UI ordering prefixes back to canonical display names", () => {
expect(normalizeAgentForPrompt(getAgentListDisplayName("sisyphus"))).toBe("Sisyphus - Ultraworker")