Skip to content

Same skill listed 2-3x when registered under both a shared root and a provider's native root #3774

Closed

Description

@Techno911

Scenario

A user has the same skill registered under more than one root at once — for
example a shared-user copy mirrored into a provider's own native skill
directory (e.g. a .bb/shared-provider-skills/<name> copy that is also
present, byte-for-byte, under a provider's own skills/<name> directory).
bb skill list --json and every thread's injected skill catalog then show
that one skill 2-3 times: once per scope it happens to be registered under
(shared-user, provider-user, plugin, …).

Measured on a real workspace: 123 registrations across 102 distinct skills —
21 names duplicated 2-3 times each — with the extra copies adding roughly
11 KB of repeated skill descriptions to every thread's context, on every
provider, regardless of which provider is actually running.

Current behavior (permalink)

listProjectSkills concatenates four independently-scanned groups
(provider-native scan, shared roots, bb-owned, plugin) with no dedup across
them — only assembleSkillList dedups within the provider-native group, by
filePath, which does nothing for a skill that exists at two different
paths:

export async function listProjectSkills(
deps: AppDeps,
args: { workspace: CommandWorkspace },
): Promise<SkillSummary[]> {
const skillProviders = deps.providerRegistry
.list()
.filter(providerHasNativeRootSurface);
const [perProvider, sharedSkills] = await Promise.all([
Promise.all(
skillProviders.map(
async (registration): Promise<ProviderSkillDiscovery> => {
const result = await scanProviderNativeRoots(deps, {
type: "host.list_skills",
registration,
hostId: args.workspace.hostId,
cwd: args.workspace.cwd,
});
return { provider: registration.info.id, skills: result.skills };
},
),
),
resolveSharedSkills(deps, {
hostId: args.workspace.hostId,
cwd: args.workspace.cwd,
}),
]);
return [
...assembleSkillList(perProvider),
...sharedSkills.summaries,
...listServerOwnedSkills(deps),

Expected behavior

The same skill (same SKILL.md content) should be listed once, using the
entry with the widest applicable scope, while every previously-issued
skillId for any of its registrations keeps resolving for read/write/delete
(some ids belong to registrations that are otherwise indistinguishable
duplicates from the user's point of view, but a caller may already hold one
of those ids). Two different skills that merely happen to share a name
must never be merged — only identical SKILL.md bytes should collapse.

Prototype

A fix along these lines is worked out in a fork branch: dedup by SKILL.md
content digest rather than name, computed for free by hashing the file once
during the frontmatter read that discovery already does (host-daemon), and
reusing that digest server-side; local (bb-owned/plugin) skills are hashed
directly since they already live on the bb server's own disk. Resolution by
skillId still searches the full, undeduped registration list, so no
previously-issued id stops resolving.

Techno911@e4750935c

Happy to open a PR against this against main if that diff direction looks
right — flagging as an issue first since it touches the DiscoveredSkill
wire schema (adds an optional contentSha256 field).

Activity

  1. added theissue type on Sep 16, 2026
  2. added
    providers
    confirmed-repro
    on Sep 16, 2026
  3. bb-slop-cop commented on Sep 16, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Bug · Priority: Medium · Effort: High and providers.

    Reproduction and root-cause report: REPRODUCED, high confidence; reproduction label: confirmed-repro.

    The server concatenates shared and provider registrations, while provider deduplication compares only file paths. The focused API test failed as expected in two clean main checkouts: one expected entry, two returned (shared-user, provider-user). All 47 existing focused tests passed. Host discovery was simulated; the claimed context overhead across every provider remains unverified.

    No PR: content identity, scope precedence, and preservation of existing IDs require protocol/design work beyond this rule’s simple-fix limits.

  4. added a commit that references this issue on Oct 23, 2026
    5a89b18
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-reproproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions