Skip to content

[Bug]: $ commands with spaces #10957

Description

@poitee

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

Please note that when using $ or / commands in the chat window, skills with spaces in their names may not display correctly, being truncated after the space. This issue is reproducible, at least on Android 17.

Expected behavior

The skill should be fully displayed properly.

Actual behavior

Using a skill with a space causes malformation of the skill

Impact

Minor bug or occasional failure

Version or commit

No response

Environment

No response

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

No response

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 9, 2026
  2. poitee commented on Sep 9, 2026

    @poitee
    Author

    Apologies it appears someone reported this right before I did. Pinky promise I searched.

  3. juliusmarminge commented on Sep 9, 2026

    @juliusmarminge
    Member

    Triage

    Confirmed as a real composer token bug. When a skill name contains a space, $ / / insert $<name> and the shared tokenizer cuts the chip at the first space. Reported on Android 17; the split is in shared parsing, not Android-only drawing.

    Not a duplicate of #10956 (focus-loss after skill select). No open PR fixes this. #9235 / PR #9244 fixed digit-leading names ($2spec) in the same regex family and still forbids spaces. PR #8982 tried quoted $"name" tokens and was closed unmerged (wrong repo).

    What’s going on

    Insert (mobile + web)

    • Mobile: resolveComposerCommandSelection in apps/mobile/src/features/threads/use-composer-command-menu.ts writes `$${item.skill.name} `.
    • Web: apps/web/src/components/chat/ChatComposer.tsx does the same.
    • / skill rows use that same $name insert (#7737 path).

    Tokenize

    • SKILL_TOKEN_REGEX in packages/shared/src/composerInlineTokens.ts only allows [a-zA-Z0-9:_-]*, then a space.
    • So $Create Hook becomes skill "Create" + leftover "Hook ". Chip label is looked up by full name, so displayName is lost too.
    • The same pattern is copied in mobile markdown (nativeMarkdownText.ts), web timeline (SkillInlineText.tsx), Claude dispatch, and Cursor rewrite — first-word chips and first-word invocation.
    • $ / / triggers in packages/shared/src/composerTrigger.ts also stop at whitespace (file mentions already support @"quoted path"; skills do not).

    Why names have spaces

    • ServerProviderSkill.name is an unrestricted trimmed string.
    • Cursor uses the skill directory basename; Claude uses the directory entry. Folders / titles like Create Hook or land it are valid catalog names.

    Android

    • T3ComposerEditorView.kt paints whatever JS token ranges it is given. Truncation will look like a malformed chip on Android even though the bug is shared.

    Suggested fix

    1. Add serializeComposerSkillToken (quote + escape names with spaces), same idea as serializeComposerFileLink / @"…".
    2. Extend SKILL_TOKEN_REGEX (and every dispatch/timeline copy) to accept $"quoted name" the way MENTION_TOKEN_REGEX already accepts quoted paths.
    3. Insert the serialized token from both $ and / skill picks (mobile + web).
    4. Optional: slugify discovery name and keep the title on displayName so $create-hook stays the token.
    5. Test $Create Hook → one chip / one dispatch; keep $kebab-case and $2spec / $20k behavior from fix(skills): support names beginning with digits #9244.

    Severity: minor (broken chip + first-word dispatch when a name has spaces). Accepting — small, localized follow-up to the #9244 tokenizer work.

  4. added
    acceptedfeature request accepted
    via-triageFiled through npx t3 triage
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions