Skip to content

Plugin file openers reject extensions with an underscore (kicad_pcb) #5834

Closed

Description

@chiefautism

The workflow

I am building a plugin that opens KiCad projects (schematic, board, 3D) in the thread panel. The natural entry point is a file opener for .kicad_pcb, .kicad_sch and .kicad_pro, so a click on one of those files in chat or in the file tree opens the viewer.

What happens today

Registering the opener fails, and the whole frontend of the plugin is dropped:

app.slots.fileOpener({ id: "kicad", title: "KiCad", extensions: ["kicad_pcb", "kicad_sch", "kicad_pro"], component: KicadFile });
frontend registration failed: slots.fileOpener: extensions must be lowercase alphanumerics without the dot, got "kicad_pcb"

The check is in packages/plugin-sdk/src/internal/plugin-app-collector.ts (/^[a-z0-9]+$/). The resolver itself already handles such names: getFileExtension in apps/app/src/lib/plugin-slot-resolvers.ts takes everything after the last dot, so board.kicad_pcb gives kicad_pcb. Only the registration check rejects it.

What you would expect

Allow _ and - inside an extension, still lowercase, no dots:

-          if (typeof extension !== "string" || !/^[a-z0-9]+$/.test(extension)) {
+          if (typeof extension !== "string" || !/^[a-z0-9]+(?:[_-][a-z0-9]+)*$/.test(extension)) {
             throw new Error(
-              `${kind}: extensions must be lowercase alphanumerics without the dot, got ${JSON.stringify(extension)}`,
+              `${kind}: extensions must be lowercase alphanumerics (inner "_" or "-" allowed) without the dot, got ${JSON.stringify(extension)}`,
             );

plus a passing case for kicad_pcb next to the failing case in apps/app/src/lib/plugin-app-definition.test.ts, and the same wording in the extensions doc comment in app-contract.ts. Happy to send this as a PR after sign-off.

Context and alternatives

Real extensions with _ or -: KiCad (kicad_pcb, kicad_sch, kicad_pro, kicad_sym, kicad_mod, kicad_wks), VS Code code-workspace, Sublime sublime-project.

Workaround in my plugin: a thread header button plus a thread panel action that lists the KiCad projects in the workspace, and an agent tool that opens the panel. It works, but a click on a .kicad_pcb link in chat still opens raw text.

Version: bb 0.46.1, Plugin SDK 0.6.49.

Checks

  • I searched open and closed issues for the same request.

AGENT GENERATED

Activity

  1. added theissue type on Oct 20, 2026
  2. added
    plugins
    confirmed-repro
    on Oct 20, 2026
  3. bb-slop-cop commented on Oct 20, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Low · area plugins.
    • Report: https://get-bb.github.io/reports/issues/5834.html — REPRODUCED, root-cause confidence high. The same regression failed in two clean checkouts of trusted main.
    • Root cause: The file-opener collector rejects non-alphanumeric extension characters before the resolver can match them. The frontend failure handler then deactivates the plugin generation; that lifecycle effect was inspected in source, not exercised in a browser.
    • Reproduction label: confirmed-repro.
    • Fix: Allow internal separators in file opener extension registration #5835 — ready for review, not merged; 73 changed text lines across 4 files. The focused regression fails before the fix and passes afterward. Relevant app tests (82), SDK tests (376), Plugin Guide tests (72), typechecks, formatting, and diff checks pass.

    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-reproplugins

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions