Skip to content

fix(agent-display): remove ZWSP sort prefixes that truncate agent names in terminals#3419

Open
fr1sk wants to merge 1 commit intocode-yeongyu:devfrom
fr1sk:fix/zwsp-agent-display-truncation
Open

fix(agent-display): remove ZWSP sort prefixes that truncate agent names in terminals#3419
fr1sk wants to merge 1 commit intocode-yeongyu:devfrom
fr1sk:fix/zwsp-agent-display-truncation

Conversation

@fr1sk
Copy link
Copy Markdown

@fr1sk fr1sk commented Apr 14, 2026

Summary

  • Set AGENT_LIST_SORT_PREFIXES values to empty strings to eliminate agent name truncation in VS Code, WezTerm, and Linux terminals
  • Preserve stripping utilities (stripInvisibleAgentCharacters, stripAgentListSortPrefix) for backward compatibility with old sessions

Fixes #3418
Also addresses #3337, #3347, #3379 (same root cause)

Problem

AGENT_LIST_SORT_PREFIXES prepends 1-4 \u200B (zero-width space) characters to core agent display names for UI list ordering. Terminals that don't treat ZWS as zero-width (VS Code integrated terminal, WezTerm, Linux emulators) clip the visible agent name, producing truncated labels like ltraworker instead of Ultraworker.

Ghostty handles ZWS correctly and is unaffected.

Fix

The ZWSP prefixes are redundant — CANONICAL_CORE_AGENT_ORDER in agent-priority-order.ts already handles sorting via the order field injection. Setting prefix values to empty strings removes the visual corruption while keeping the map shape intact for callers.

Changes

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

Testing

bun run typecheck  # passes
bun test src/shared/agent-display-names.test.ts  # pre-existing test-setup failure on dev, unrelated

PR Checklist

  • Code follows project conventions
  • bun run typecheck passes
  • bun run build succeeds
  • No version changes in package.json

Summary by cubic

Remove zero‑width space sort prefixes from core agent display names to stop truncation in VS Code, WezTerm, and Linux terminals. Sorting now relies on the canonical order field so names render cleanly. Fixes #3418; also addresses #3337, #3347, #3379.

  • Bug Fixes
    • Set AGENT_LIST_SORT_PREFIXES to empty strings for core agents.
    • Keep stripInvisibleAgentCharacters and stripAgentListSortPrefix for backward compatibility.
    • Update tests to expect prefix-free display names.

Written for commit 12eb7d0. Summary will update on new commits.

…es in terminals

Set AGENT_LIST_SORT_PREFIXES values to empty strings. The zero-width space
(U+200B) prefixes caused agent name truncation in VS Code integrated terminal,
WezTerm, and Linux terminal emulators. Sorting already relies on the order
field injected by CANONICAL_CORE_AGENT_ORDER in agent-priority-order.ts.

Stripping utilities are preserved for backward compatibility with sessions
that still contain ZWSP-prefixed names.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@fr1sk
Copy link
Copy Markdown
Author

fr1sk commented Apr 14, 2026

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

github-actions bot added a commit that referenced this pull request Apr 14, 2026
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.

Auto-approved: Safely removes invisible characters causing terminal truncation. Sorting logic has been moved to the order field as noted. Tests are updated to reflect the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ZWSP sort prefixes truncate agent names in VS Code terminal (Ghostty unaffected)

1 participant