Skip to content

Agent names displayed incorrectly with ZWSP characters in TUI (e.g., "Ultraworker" → "ltraworker") #23049

Closed as not planned

Description

@CoolstrangerFJ

Description

When using oh-my-openagent plugin with OpenCode TUI, agent names are displayed incorrectly - missing the first few characters. This is caused by zero-width space (ZWSP, U+200B) characters used for sort prefixes in AGENT_LIST_SORT_PREFIXES.

Environment

  • OpenCode version: 1.4.0
  • oh-my-openagent version: 3.17.4
  • Terminal: iTerm2 on macOS
  • TERM: xterm-256color
  • Locale: zh_CN.UTF-8

Symptoms

Expected Actual
Sisyphus - Ultraworker Sisyphus - ltraworker (missing 'U')
Prometheus - Plan Builder Prometheus - Plan lder (missing 'Bui')

The number of missing characters correlates with the number of ZWSP characters in AGENT_LIST_SORT_PREFIXES:

  • sisyphus: 1 ZWSP → 1 char missing
  • prometheus: 3 ZWSPs → 3 chars missing

Root Cause

oh-my-openagent uses ZWSP characters for sorting agent names in the dropdown:

AGENT_LIST_SORT_PREFIXES = {
  sisyphus: "\u200B",
  hephaestus: "\u200B\u200B",
  prometheus: "\u200B\u200B\u200B",
  atlas: "\u200B\u200B\u200B\u200B"
};

While v3.17.3/v3.17.4 added stripInvisibleAgentCharacters() for agent lookups, the TUI display still shows these ZWSP characters, and certain terminals/font configurations render them as having actual width, causing the first visible characters to be "eaten".

Related Issues

Suggested Fix

The OpenCode TUI should properly handle zero-width Unicode characters (U+200B, U+200C, U+200D, U+FEFF) when calculating string width for display. These characters should have zero display width in all terminals.

Alternatively, oh-my-openagent could use a different mechanism for sorting that doesn't involve invisible characters.

Activity

  1. CoolstrangerFJ commented on Apr 17, 2026

    @CoolstrangerFJ
    Author
    Image Image Image
  2. NobleXL commented on Apr 18, 2026

    @NobleXL

    最新版的opencode修复了这个bug嘛?

  3. ttimasdf commented on Apr 23, 2026

    @ttimasdf

    最新版的opencode修复了这个bug嘛?

    No, but I found a workaround. Run opencode inside a tmux and the ZWSP disappears. 🤯

  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions