Skip to content

Composer: an @ followed by prose keeps the mention menu open for 255 characters #6996

Closed

Description

@sms-yui

Summary

Typing @ followed by prose in the composer keeps the mention typeahead open for the next 255 characters, showing "Searching mentions…" / "No matching mentions" and re-running the mention search on every keystroke. The menu only closes once the @ falls out of a fixed 256-character scan window. Expected: once a multiword @ query plainly matches nothing, the menu should close and the text should stay plain prose, the same way an unmatched / command already does.

Versions and environment

  • bb 0.48.1 (CLI), macOS 26.5.2
  • Code checked on get-bb/bb main at 642267b7f7
  • Composer plugin (plugins/composer), default @ mention trigger; no provider involvement

Steps to reproduce

  1. Open any thread's composer.
  2. Type this prompt, character by character, on one line:
    in the composer plugin, allow me to @[model name/reasoning level/machine/project/permission mode] in the composer input (selection shown like the normal mentions) and after it's selected the chip just immediately dissapears but the model/reasoning level/machine/project is set to the composer. only starred model in the model picker should show up in the @
    
  3. Watch the mention menu from the first @ onward.

The menu stays open while typing the next 255 characters (through …set to the composer. o) and then closes on its own. Any @ preceded by a space reproduces it; the brackets and slashes are not required.

Expected vs actual

Actual (findActiveTrigger on the prompt above, caret after N characters; first "@" is at index 36):
caret  37  -> mention, from 36, query ""
caret  60  -> mention, from 36, query "[model name/reasoning l"       (23 chars)
caret 200  -> mention, from 36, query "[model name/reasoning level/…" (163 chars)
caret 291  -> mention, from 36, query length 254
caret 292  -> null   (the "@" left the 256-char scan window)

Expected: the trigger ends, or the menu hides, once the multiword query has no results, rather than tracking the @ until the scan window drops it.

Evidence

Cause (observed in code):

Repro method: a scratch Vitest file in plugins/composer/src/mentions/ called the real findActiveTrigger with triggers [{ char: "@", kind: "mention" }, { char: "/", kind: "command" }] for every caret position in the prompt above. The table above is its output.

What you ruled out

Possible fix directions (for triage, not prescriptive):

  • End a multiword mention session once a query containing a space returns zero results after loading, and treat the @ as literal like isCommandTriggerLiteral.
  • Cap multiword queries at a small number of words or characters instead of relying on the scan window.

Suggested priority and effort

Medium: it hits anyone who writes @ mid-prose, such as specs, emails, or the @ syntax itself. There is a workaround (Escape), and no text is lost. Effort is probably low.

Reported from bb thread @thread:thr_i23unmchia.

AGENT GENERATED

Activity

  1. added theissue type on Nov 4, 2026
  2. added
    ui
    confirmed-repro
    on Nov 4, 2026
  3. bb-slop-cop commented on Nov 4, 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 real-composer regression fails in two clean checkouts of trusted main; a separate parser probe confirms the scan-window cutoff.
    • Root cause: multiword parsing accepts spaces, but completed empty mention searches never retire the occurrence, so the empty menu and search input remain active.
    • Fix: ready PR #7002, not merged. Two files, 111 changed lines. The regression now passes; 184 composer tests and 96 plugin tests pass, plus lint/typecheck. Pending searches, errors, attachment matches, and valid multiword mentions remain supported.
    • Limit: browser screenshots were blocked by missing Chrome/Chromium; verification uses the actual composer DOM and parser on Linux, not macOS.

    AGENT GENERATED

  4. added a commit that references this issue on Nov 4, 2026
    631a626
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