Skip to content

@-mention path search fails for Cyrillic filenames when query contains uppercase Cyrillic letters #7275

Closed

Description

@gnezim

@-mention path search fails for Cyrillic filenames when query contains uppercase Cyrillic letters

Environment

  • bb version: 0.49.0 (Stable)
  • Platform: macOS (Apple Silicon)
  • Workspace: a large Obsidian-style Markdown vault with many Cyrillic filenames

Summary

The @-mention file/folder picker in the composer does not find files whose names contain Cyrillic characters when the typed query includes an uppercase Cyrillic letter. Files are only findable when the query is typed entirely in lowercase.

The same files are found by bb's general search and file navigation — the problem is specific to the @-mention composer path picker.

Root cause (confirmed in compiled source)

The @-mention path search calls fuzzyMatchPaths() in apps/host-daemon/src/command-handlers/file-list.ts, which delegates to rankPlainQueryMatches():

const matcher = new Fzf(items, {
  selector: (item) => item.path,
  casing: "smart-case",   // ← problem
  forward: true,
  tiebreakers,
});

The vendored fzf implementation (packages/fuzzy-match/) uses this casing logic:

case "smart-case":
  if (query.toLowerCase() !== query) {
    caseSensitive = true;
  }

query.toLowerCase() !== query is true for any uppercase character — including uppercase Cyrillic (e.g. С U+0421). This switches matching to case-sensitive mode, but on-disk paths in this workspace use lowercase kebab-case slugs (e.g. actors/<cyrillic-slug>.md), so a query starting with a capital Cyrillic letter cannot match them.

Reproduction (API-level, deterministic)

All requests against the same project (/api/v1/projects/<id>/paths?query=…&limit=16&includeFiles=true&includeDirectories=true), with <cyrillic-word> standing for a lowercase kebab-case filename present in the workspace (anonymized here):

Query Case Result
<cyrillic-word> (lowercase) all lowercase Cyrillic 16 results, includes actors/<cyrillic-word>.md ✅
<Cyrillic-Word> (capitalized) leading uppercase Cyrillic 0 results ❌
<Cyr> (capitalized prefix) uppercase Cyrillic prefix 16 results, but only files with uppercase Cyrillic in name; misses <cyrillic-word>.md ❌
<cYr> uppercase Cyrillic in middle 0 results ❌
<cyR> uppercase Cyrillic in middle 0 results ❌
dacha (control) all lowercase ASCII 15 results, includes projects/personal/dacha/dacha.md ✅

The UI shows "No matching mentions" for the capitalized Cyrillic query but immediately shows Workspace results for the lowercase ASCII control query, confirming this is a matching bug rather than an indexing problem.

Expected behavior

A capitalized Cyrillic query should find the same lowercase kebab-case filename as its all-lowercase form, the same way bb's general search and file navigation do.

Suggested fix

Change the path-search Fzf instantiation to casing: "case-insensitive", or make the smart-case trigger consider only ASCII uppercase letters:

case "smart-case":
  // Only ASCII uppercase should enable case-sensitive matching
  if (/[A-Z]/.test(query)) {
    caseSensitive = true;
  }
  break;

The existing ASCII pre-filter in mayContainPathCandidateNeedle already uses ASCII-only case folding; the same principle should apply to the smart-case trigger.

Impact

Any user with non-Latin filenames (Cyrillic, Greek, Coptic, etc. in title-case source material) cannot @-mention those files unless they type the query in all lowercase. This makes the @-mention feature unusable for a significant class of real-world workspaces.

Activity

  1. added theissue type on Nov 9, 2026
  2. added
    ui
    confirmed-repro
    on Nov 9, 2026
  3. bb-slop-cop commented on Nov 9, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Low · Labels: ui, confirmed-repro.
    • Reproduction report: REPRODUCED, root-cause confidence high. The same agent repeated the matcher-level failure in two clean checkouts of trusted origin/main; the live macOS UI/API was not exercised.
    • Root cause: Unicode uppercase enables case-sensitive smart-case matching across the shared path-search branches, excluding lowercase filenames.
    • Fix: PR #7276, ready for review. Normalize queries without ASCII uppercase once at the matcher boundary, preserving ASCII smart-case. Three regression cases fail before the fix; all 36 matcher tests, typecheck, and 32 existing path-list tests pass afterward. The fix changes 42 text lines across two files.

    AGENT GENERATED

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

    confirmed-reproui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions