Skip to content

Pi skill listing drops most user skills: the recursive scan shares one 1,000-entry budget across all roots #6173

Closed

Description

@AdzeB

Summary

For Pi threads, bb's skill listing (slash picker, Settings → Skills, bb skill list) silently drops most user skills. The recursive skill scan in host-daemon shares one 1,000-entry budget across all of a provider's roots and counts every file inside every skill folder, so a normal-sized ~/.pi/agent/skills uses up the budget before the scan reaches ~/.agents/skills. Expected: every skill with a SKILL.md in a declared root is listed. Pi itself loads all of them; only bb's listing is short.

Likely a regression from #5519 (merged 2026-10-14). It made the Pi roots recursive, and its description notes that the walker "keeps descending inside skill folders" and that "BB keeps its 24-level and 1,000-entry bounds". Before that, the shallow scan of these roots had no entry budget.

Versions and environment

  • bb 0.46.1 (desktop app), macOS 26.5.1
  • pi 1.4.0
  • Local machine, project checkout environment, default data dir

Steps to reproduce

  1. Have a user skill root with skill folders that together hold more than 1,000 files and folders (references/, scripts/, assets/ count). Mine: ~/.pi/agent/skills has 213 skills and about 3,450 entries (find -L ~/.pi/agent/skills -mindepth 1 | wc -l); ~/.agents/skills has about 300 skills and about 5,000 entries.
  2. bb skill list --json | jq '[.skills[] | select(.provider=="pi")] | length'
  3. bb skill list --json | jq -r '.skills[] | select(.name=="app-designer") | .provider' (app-designer exists only in ~/.agents/skills)

Untested minimal recipe for a clean machine: create 60 skills in ~/.pi/agent/skills, each with a SKILL.md and 20 files in references/; fewer than 60 will be listed for pi.

Expected vs actual

Actual:   49 pi skills listed, alphabetically agent-browser … docx (the first 50 root entries; one is dropped for an invalid name).
          domain-modeling … and every later skill in ~/.pi/agent/skills is missing.
          Nothing from ~/.agents/skills is listed for pi. app-designer shows only for claude-code and codex.
Expected: every SKILL.md under ~/.pi/agent/skills and ~/.agents/skills is listed for pi.

Evidence

  • apps/host-daemon/src/command-discovery.ts at 1e80ca7:
    • 1,000-entry cap:
      const MAX_SCAN_ENTRY_COUNT = 1_000;
    • every directory entry read takes one from the budget:
      async function readDirEntries(
      dirPath: string,
      budget?: ScanBudget,
      ): Promise<Dirent[] | null> {
      try {
      const directory = await fs.opendir(dirPath);
      const entries: Dirent[] = [];
      for await (const entry of directory) {
      if (budget?.remainingEntries === 0) {
      break;
      }
      if (budget !== undefined) {
      budget.remainingEntries -= 1;
      }
      entries.push(entry);
      }
      return entries.sort(sortDirentsByName);
    • walkSkillTree keeps going into a skill folder after it finds its SKILL.md:
      async function walkSkillTree(args: WalkSkillTreeArgs): Promise<void> {
    • discoverSkills gives all roots one budget:
      export async function discoverSkills(
      args: DiscoverSkillsArgs,
      ): Promise<DiscoveredSkill[]> {
      const records: DiscoveredSkill[] = [];
      const budget = { remainingEntries: MAX_SCAN_ENTRY_COUNT };
      for (const root of args.roots) {
  • Pi declares .pi/agent/skills and then .agents/skills as recursive user roots (plugins/provider-pi/src/native-roots.ts), so the second root gets no budget.
  • The cut falls exactly at the budget: line 50 of the sorted root listing is docx, and line 51 is domain-modeling, the first missing skill.
  • Thread: thr_5n48kevs7t

What you ruled out

Suggested priority and effort (optional)

Medium: hits any Pi user with a few dozen real skills; the only workaround is asking for the skill by name. Effort low: stop going into a folder once its SKILL.md is found, give each root its own budget, or count only directories.

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not. (Reproduced on 0.46.1; the code is the same on main at 1e80ca7.)
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

AGENT GENERATED

Activity

  1. added theissue type on Oct 23, 2026
  2. added
    providers
    provider-pi
    confirmed-repro
    on Oct 23, 2026
  3. bb-slop-cop commented on Oct 23, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Low. Labels: providers, provider-pi; reproduction label: confirmed-repro.
    • Reproduction report: REPRODUCED · root-cause confidence: high. The same agent reproduced four failing regressions in two clean trusted-main checkouts.
    • Root cause: recursive scans charge unrelated supporting files against one shared entry budget, hiding nested skills and starving subsequent roots.
    • Fix: PR #6174 gives each recursive skill root a candidate-directory budget while preserving nested traversal and path protections. Ready for review; not merged. Three files, 127 changed lines.
    • Verification: all 55 relevant tests, typecheck, build, formatting, and diff checks pass. Two unrelated full-suite server-move failures also reproduce on unchanged main.
  4. added 2 commits that reference this issue on Oct 23, 2026
    e6cf3f6
    5064cff
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-reproprovider-piproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions