Skip to content

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

Closed
fr1sk wants to merge 1 commit into
code-yeongyu:devfrom
fr1sk:fix/zwsp-agent-display-truncation
Closed

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

Conversation

@fr1sk

@fr1sk fr1sk commented Apr 14, 2026

Copy link
Copy Markdown

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

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

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

@fr1sk

fr1sk commented Apr 14, 2026

Copy link
Copy Markdown
Author

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

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

Copy link
Copy Markdown

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.

github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 19, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 20, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 21, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 22, 2026
github-actions Bot added a commit to Vacbo/oh-my-opencode that referenced this pull request Apr 22, 2026
@code-yeongyu

Copy link
Copy Markdown
Owner

[sisyphus-bot]

PR sweep status check on dev.

  • Review decision: APPROVED
  • Mergeable state: CONFLICTING (merge conflict with current dev)

Approved but blocked on merge conflicts. Please rebase onto current dev and resolve. Once green, the owner can merge.

Assigning code-yeongyu for owner visibility on the merge decision.

@code-yeongyu code-yeongyu self-assigned this May 16, 2026
@code-yeongyu

Copy link
Copy Markdown
Owner

[sisyphus-bot] Hi fr1sk. 🙏 Thanks for the ZWSP-truncation fix and the careful regression test.

Picking this back up from the 5/16 approval. dev now has both stripInvisibleAgentCharacters and stripAgentListSortPrefix in src/shared/agent-display-names.ts, along with a regression test ("strips legacy zero-width sort prefixes baked into v3.14.0 to v3.16.0 sessions") that explicitly pins the symptom you were targeting. The agent-display surface has been reworked since 4/19 so the diff no longer applies cleanly (conflicts in both agent-display-names.ts and the test file).

Because the runtime fix this PR was targeting is now present on dev via a different implementation path, I'm closing this out as superseded. If you spot a place where ZWSP prefixes still leak through into terminal rendering on the latest dev (especially when the agent name comes from a runtime source that bypasses stripAgentListSortPrefix), please open a fresh issue with the reproduction and I'll happily reopen the investigation.

Really appreciate the original diagnosis; the truncation symptom was a real pain.

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)

3 participants