Skip to content

[Bug]: Pasting markdown-like filepaths causes the file picker to fail #16413

Description

@tyteen4a03

Before submitting

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

Area

apps/web

Steps to reproduce

  1. Create a file called src/__test__.tsx
  2. In the prompt box, type @, then paste in the filepath src/__test__.tsx.

Expected behavior

The editor should show the file in the file picker.

Actual behavior

The editor renders the Markdown and the file picker fails.

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 Oct 6, 2026
  2. juliusmarminge commented on Oct 6, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Triage

    Thanks @tyteen4a03 for the clear repro, that made this easy to trace.

    What I found

    • This reproduces on current main with the rich-text composer, which is on by default. It doesn't look like a duplicate of the other composer formatting reports (including [Bug]: @ mention search closes on spaces in file, folder, and thread names #15156).
    • Typing @ and then pasting src/__test__.tsx goes through paste handling in ComposerPromptEditorTiptap, which parses the clipboard with parseInlineMarkdown. In src/__test__.tsx the __ pair is flanked by / and ., so the parser treats it as bold and the document is stored as @src/**test**.tsx.
    • The editor then renders test in bold, and the file picker searches for src/**test**.tsx. Path search is a subsequence match and * never matches _, so src/__test__.tsx is dropped and the menu shows "No matching files or folders."
    • The same rewrite affects other dunder paths such as __tests__/, __init__.py, and __main__.py. snake_case names are unaffected, and typing the path by hand usually is too, because the bold input rule only fires when __…__ is at the start of the text or after whitespace.

    Workaround: turning off Rich text composer under Settings → General keeps pasted paths literal, so the picker can match them.

    Likely fix area

    Some options in ComposerPromptEditorTiptap paste handling:

    • Skip inline-markdown parsing for the text being pasted into an active @ mention query, so it's inserted literally.
    • Alternatively, tighten parseInlineMarkdown so __…__ only becomes bold when flanked by whitespace or punctuation boundaries that don't occur inside paths (e.g. not between / and .).

    A maintainer will decide on the fix direction.

  3. added
    via-triageFiled through npx t3 triage
    and removed
    needs-triageIssue needs maintainer review and initial categorization.
    on Oct 6, 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

    bugSomething 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