Skip to content

Skill chip picked mid-message is serialized without trailing space and never reaches Claude Code as a skill #2318

Closed

Description

@dhiyaancnirmal

bb 0.39.0, macOS, provider claude-code (thread on a remote Linux machine).

What happened

Typed a message, picked poteto-mode from the skill picker mid-sentence, kept typing. The composer rendered it as a skill chip. The prompt that reached the agent (visible in bb thread log) was:

... I am lost. /poteto-modeAlso testing out pstack for the first time!

Two problems:

  1. The chip is serialized with no trailing space, so the skill name is glued to the next word (/poteto-modeAlso).
  2. Claude Code only expands slash commands at the start of a message, so a mid-message chip is never executed as a skill regardless of spacing.

Result: the agent said "/poteto-mode isn't an installed skill" even though ~/.claude/skills/poteto-mode resolves. The skill has disable-model-invocation: true, so it is hidden from the model's catalog and the slash path was the only way to run it.

Expected

Picking a skill from the picker should invoke that skill no matter where in the message the chip sits. Either:

  • serialize the chip at the start of the prompt (/poteto-mode <rest of message>), or
  • inject the skill's SKILL.md content the way bb does for its own global skills, independent of the provider's slash parser.

At minimum, emit a space after the chip so the name is not corrupted.

Repro

  1. New thread, provider claude-code.
  2. Type hello , pick any user-invocable skill from the picker, type world, send.
  3. bb thread log <id> shows /<skill>world; the skill does not run.

Activity

  1. added theissue type on Aug 23, 2026
  2. added
    ui
    providers
    provider-claude-code
    on Aug 23, 2026
  3. SawyerHood commented on Aug 24, 2026

    @SawyerHood
    Collaborator

    ---Auto-Generated---

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2318.html

    • Verdict: PARTIALLY REPRODUCED · root-cause confidence: high
    • Root cause (short): The command-mention pill serializes as bare /name with no word-boundary guard (prompt-editor-serialization.ts#L980-L996) — the pick-time space is the only separator, it is trimmed on send (prompt-draft.ts#L268-L270) and every restore path (history recall, queued/sent-message edit) and insertTextAtCursor put text directly behind the pill; independently the claude-code bridge forwards the text verbatim (bridge.ts buildPromptText) and Claude Code 2.1.197 only expands /skill when it is the first token of the prompt, so a mid-message chip is never run as a skill.
    • Proposed fix: (1) Composer: add a word-boundary guard for command pills — either emit a separator space in serializePromptEditorNode when a non-whitespace text node directly follows a mention (keeping offsetMapping/mention ranges aligned) or add a ProseMirror appendTransaction plugin that inserts the space when text is inserted immediately after a mention node; also fix insertTextAtCursor to compute its whitespace check with the pill's serializedText instead of the "\n" leafText. The two failing tests in 2318/repro/issue-2318-skill-chip.test.tsx become the regression tests. (2) Claude Code skill invocation:…
    • Caveats: The literal issue repro (type hello , pick skill, type world) does NOT produce the glued text on the base commit or in the desktop-v0.39.0 source: the pick handler inserts a trailing space and bb thread log shows hello /poteto-mode world. The glue was reproduced live via ArrowUp history recall after a send that ended with the chip, and in unit tests for keyboard typing and insertTextAtCu…

    The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Code

  4. added
    partial-repro
    on Aug 24, 2026
  5. IlyaM commented on Sep 5, 2026

    @IlyaM
    Contributor

    I defined a BB skill and tried to invoke it. The skill was defined as user-invocable only and had specific instructions not to perform certain actions unless the user explicitly confirmed. It was a skill to file a bug report, but it was meant to show the user a preview first and ask for confirmation before being sent.

    Pi (with the GPT-5.6 SOL model) did not load the skill. It instead treated the literal invocation text as an ordinary user request and proceeded without the skill's confirmation workflow. I troubleshot this and found that BB does not preserve the skill invocation as such at the provider boundary: it is passed as prompt text, so the model makes incorrect assumptions. I did not test this live with other providers, but read-only analysis shows that Claude Code, and possibly other providers, have the same problem.

    Additional reproduction: first-token BB skill invocation with Pi

    Environment:

    • bb 0.42.1 from source at dba32a469fd820ff6106715db0aaf6ed297d79a5
    • Pi 0.85.0
    • openai-codex/gpt-5.6-sol
    • Linux x86_64

    Steps:

    1. Create a skill named file-bug-report with disable-model-invocation: true and instructions requiring a preview plus a separate approval before submission.
    2. Select that skill from BB's / picker at the beginning of a new thread and include bug details after the chip.
    3. Send the prompt.
    4. Inspect bb thread log <thread-id> --format json --all.

    Observed request input:

    /file-bug-report <bug details>
    

    The structured input contains a command mention whose resource has kind: "command", source: "skill", and name: "file-bug-report". However, Pi receives only the text. Because Pi's explicit native syntax is /skill:file-bug-report, the hidden skill is not loaded. The model therefore interprets /file-bug-report as ordinary imperative text; in this reproduction it created the GitHub issue without showing the required preview or requesting approval.

    Expected: selecting a BB skill invokes that exact skill independently of provider-native command syntax. The structured skill identity must survive to the provider adapter; an explicit skill invocation must not be reduced to a text prompt whose meaning the model guesses.

    Source evidence and cross-provider scope

    • The Pi bridge extracts only text and attachments, discarding text-item mention metadata:
      function extractInput(input: TurnStartParams["input"]): ExtractedInput {
      const chunks: string[] = [];
      const images: ImageContent[] = [];
      for (const item of input) {
      if (!item || typeof item !== "object") continue;
      const typed = item as {
      type?: string;
      text?: string;
      path?: string;
      mimeType?: string;
      };
      if (typed.type === "text" && typeof typed.text === "string") {
      chunks.push(typed.text);
      } else if (typed.type === "localImage" && typeof typed.path === "string") {
      try {
      const data = readFileSync(typed.path).toString("base64");
      const mimeType = typed.mimeType ?? mimeTypeFromExtension(typed.path);
      images.push({ type: "image", data, mimeType });
      } catch {}
      } else if (typed.type === "localFile" && typeof typed.path === "string") {
      chunks.push(`[Attached file: ${typed.path}]`);
      }
      }
    • It then passes that text directly to Pi's prompt API:
      function startPiPrompt(
      threadSession: ThreadSession,
      threadId: string,
      text: string,
      images: ImageContent[],
      ): Promise<void> {
      const dispatch = threadSession.session.prompt(
      text,
      images.length > 0 ? images : undefined,
      );
    • Pi documents explicit skill invocation as /skill:<name> and says disable-model-invocation: true excludes the skill from the model prompt: https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/skills.md#skill-commands
    • The Claude Code bridge likewise builds provider input from entry.text without using mention metadata:
      function buildPromptText(input: unknown): string | undefined {
      if (typeof input === "string") {
      return input.length > 0 ? input : undefined;
      }
      if (!Array.isArray(input)) return undefined;
      const chunks: string[] = [];
      for (const item of input) {
      const parsed = promptInputItemSchema.safeParse(item);
      if (!parsed.success) continue;
      const entry = parsed.data;
      switch (entry.type) {
      case "text":
      if (entry.text.length > 0) chunks.push(entry.text);
      break;
      case "image":
      chunks.push(`[Attached image: ${entry.url}]`);
      break;
      case "localImage":
      chunks.push(localAttachmentMarker({ kind: "image", path: entry.path }));
      break;
      case "localFile":
      chunks.push(
      localAttachmentMarker({
      kind: "file",
      path: entry.path,
      name: entry.name,
      mimeType: entry.mimeType,
      sizeBytes: entry.sizeBytes,
      }),
      );
      break;
      }
      }
      return chunks.length > 0 ? chunks.join("\n") : undefined;
    • BB injects global Claude skills through a plugin named bb-global-skills:
      const MANIFEST_SCHEMA = "https://anthropic.com/claude-code/plugin.schema.json";
      function pluginDirectoryName(root: ClaudeSkillPluginRoot): string {
      return createHash("sha256")
      .update(`${root.id}\0${root.path}`)
      .digest("hex")
      .slice(0, 16);
      }
      export const CLAUDE_SKILL_PLUGIN_NAME = "bb-global-skills";
      function pluginNameFor(
      root: ClaudeSkillPluginRoot,
      takenBy: ReadonlyMap<string, string>,
      ): string {
      const directory = pluginDirectoryName(root);
      const owner = takenBy.get(CLAUDE_SKILL_PLUGIN_NAME);
      if (owner === undefined || owner === directory) {
      return CLAUDE_SKILL_PLUGIN_NAME;
      }
    • Claude Code namespaces plugin skills as /plugin-name:skill-name, so the BB text /file-bug-report does not match the injected /bb-global-skills:file-bug-report: https://code.claude.com/docs/en/slash-commands#skill-locations

    Suggested fix

    Treat a BB skill mention as a semantic invocation rather than provider-neutral text. Resolve the selected skill before execution and either inject its rendered content through a canonical bridge field or translate it into each provider's native invocation mechanism. Preserve the remaining user text as the skill's arguments.

    Audit every provider exposed through BB—not only Pi and Claude Code—to determine whether its adapter preserves structured skill-invocation semantics or relies on literal prompt text. This should explicitly cover Codex and the shipped ACP-backed providers, with any provider-specific command syntax or namespacing recorded.

    Regression coverage should prove that a disable-model-invocation: true skill selected through BB loads on every provider that supports BB skills, both at the beginning of a prompt and mid-message, and that ordinary text resembling /skill-name is not upgraded without structured mention metadata.

    This extends #2318 beyond its spacing and Claude-specific reproduction: even a correctly separated, first-token skill chip fails when BB's display command differs from the provider-native command. No public-safe investigation thread link is available.

    AGENT GENERATED

  6. banjerluke commented on Oct 1, 2026

    @banjerluke

    I've been running into this issue a lot; not so much the lack of a trailing space but the fact that it never reaches Claude; I get a lot of messages like "~/.claude/skills/grill-with-docs exists on disk, but it isn't in this session's skill list." (This being one of the skills with disable-model-invocation: true.)

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

    partial-reproprovider-claude-codeprovidersui

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions