Skip to content

fix(agent-display): remove ZWSP from agent sort prefixes (fixes #3337)#3374

Open
MoerAI wants to merge 1 commit intocode-yeongyu:devfrom
MoerAI:fix/remove-zwsp-from-agent-sort-prefixes
Open

fix(agent-display): remove ZWSP from agent sort prefixes (fixes #3337)#3374
MoerAI wants to merge 1 commit intocode-yeongyu:devfrom
MoerAI:fix/remove-zwsp-from-agent-sort-prefixes

Conversation

@MoerAI
Copy link
Copy Markdown
Contributor

@MoerAI MoerAI commented Apr 13, 2026

Summary

  • Remove zero-width space (ZWSP) characters from agent list sort prefixes that cause display corruption in terminals

Problem

Agent names display incorrectly in TUI on terminals that don't render ZWSP (\u200B) characters properly. The AGENT_LIST_SORT_PREFIXES map prepends 1-4 ZWSP characters to core agent display names for list ordering, but many terminals (WezTerm, Linux terminal emulators) render these as visible artifacts or truncate the agent name.

Fix

Set all AGENT_LIST_SORT_PREFIXES values to empty strings. The invisible character stripping utilities (stripInvisibleAgentCharacters, stripAgentListSortPrefix) are preserved for backward compatibility with old sessions that may still contain ZWSP-prefixed names.

Changes

File Change
src/shared/agent-display-names.ts Set ZWSP sort prefix values to empty strings
src/shared/agent-display-names.test.ts Update test expectations for prefix-free display names

Fixes #3337
Also resolves #3307 and #3347 (same root cause)


Summary by cubic

Remove zero‑width space sort prefixes from core agent display names to fix terminal rendering issues. Keeps stripping helpers for backward compatibility. Fixes #3337; also resolves #3307 and #3347.

  • Bug Fixes
    • Set all sort prefixes to empty strings so names render correctly in TUIs.
    • Retain invisible-character stripping utilities for old ZWSP-prefixed sessions.
    • Update tests to expect prefix‑free display names.

Written for commit 7adbc44. Summary will update on new commits.

@MoerAI
Copy link
Copy Markdown
Contributor Author

MoerAI commented Apr 13, 2026

I have read the CLA Document and I hereby sign the CLA

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Removing ZWSP sort prefixes changes the UI sort order for agents (e.g., Atlas moves from 4th to 1st), which constitutes a functional regression in sorting logic.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 56e02e2ad3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +30 to +33
sisyphus: "",
hephaestus: "",
prometheus: "",
atlas: "",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Restore non-visible runtime prefixes for core agent ordering

Setting all core entries in AGENT_LIST_SORT_PREFIXES to empty strings removes the only runtime signal used to keep Sisyphus/Hephaestus/Prometheus/Atlas in canonical order when consumers sort by name (src/plugin-handlers/AGENTS.md documents Agent.list() using localeCompare on name). With these values empty, getAgentRuntimeName() now emits plain display names, so any name-based sort will reorder core agents alphabetically (Atlas first) instead of the required sisyphus → hephaestus → prometheus → atlas order.

Useful? React with 👍 / 👎.

@MoerAI
Copy link
Copy Markdown
Contributor Author

MoerAI commented Apr 13, 2026

CI: 4578 pass, 2 fail. The 2 failures are in generateOmoConfig model-fallback snapshot tests that reference ZWSP-prefixed agent display names as keys. These snapshots need regeneration via bun test --update-snapshots. The 4578 passing tests confirm the ZWSP removal is safe across the codebase.

@MoerAI MoerAI force-pushed the fix/remove-zwsp-from-agent-sort-prefixes branch from 56e02e2 to 7adbc44 Compare April 13, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant