Skip to content

fix(agents): strip ZWSP sort-order prefixes and normalize dash-format agent names#488

Open
stevejkang wants to merge 2 commits intojunhoyeo:mainfrom
stevejkang:fix/normalize-agent-display-names
Open

fix(agents): strip ZWSP sort-order prefixes and normalize dash-format agent names#488
stevejkang wants to merge 2 commits intojunhoyeo:mainfrom
stevejkang:fix/normalize-agent-display-names

Conversation

@stevejkang
Copy link
Copy Markdown
Contributor

@stevejkang stevejkang commented Apr 29, 2026

Summary

  • Strip zero-width Unicode characters (U+200B, U+200C, U+200D, U+FEFF) from agent names during normalization
  • Add dash-format agent name matching (Name - Description) alongside legacy parenthesized format (Name (Description))
  • Normalize cached agent names on TUI cache load and merge duplicate entries that resolve to the same canonical name
  • Bump TUI cache schema version to invalidate stale entries containing raw ZWSP-polluted names

Context

oh-my-openagent changed agent display format from parenthesized (Sisyphus (Ultraworker)) to dash-separated (Sisyphus - Ultraworker) due to RFC 7230 header validation failures with parentheses in OpenCode's x-opencode-agent-name header.

Additionally, oh-my-openagent prepends U+200B (Zero Width Space) characters as invisible sort-order prefixes for UI agent list ordering:

Agent ZWSP Count Runtime Name
Sisyphus 1 \u200BSisyphus - Ultraworker
Hephaestus 2 \u200B\u200BHephaestus - Deep Agent
Prometheus 3 \u200B\u200B\u200BPrometheus - Plan Builder
Atlas 4 \u200B\u200B\u200B\u200BAtlas - Plan Executor

These ZWSP-prefixed names leak into opencode.db via the agent config name field → OpenCode stores them in the message mode field → tokscale reads garbled entries.

Before

Screenshot 2026-04-29 at 15 23 11

After

Screenshot 2026-04-29 at 15 23 19

stevejkang and others added 2 commits April 29, 2026 15:31
… agent names

oh-my-openagent changed agent display format from "Name (Description)"
to "Name - Description" and prepends U+200B zero-width spaces for UI
list ordering. These leak into opencode.db, causing fragmented entries
in the Agents tab (e.g. " Sisyphus Ultrawo...").

- Add strip_zero_width_chars() removing U+200B/200C/200D/FEFF
- Add dash-format matching to normalize_oh_my_opencode_agent_name
- Normalize cached agent names on load and merge duplicates
- Bump cache schema version to invalidate stale entries
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
tokscale Ignored Ignored Preview Apr 29, 2026 6:33am

Request Review

Copy link
Copy Markdown
Contributor

@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

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.

1 participant