Skip to content

sync-skills --all spawns ~1,539 bash + ~4,600 jq processes; exhausts resources and hangs on constrained Windows sessions #138

Closed

Description

@panesofglass

bash scripts/sync-skills.sh (and therefore bigpowers setup, which calls it) renders every skill by spawning a separate bash process per skill × adapter, with each adapter spawning additional jq processes. That is ~1,539 bash launches plus ~4,600 jq launches from a single long-lived Python process. On a constrained Windows session this exhausts process-creation resources partway through, the run dies with STATUS_DLL_INIT_FAILED, and then it hangs instead of failing.

Repro

Windows, Git Bash, a session with a low process cap (ulimit -u = 256 here, hard, unraisable):

bash scripts/sync-skills.sh --distribute-only
python-env: Using python3
sync-skills: WARN — yq unavailable or targets.yaml missing; using legacy render list (cursor gemini pi)
Error: adapter cursor failed with exit code 0xC0000142

…and the command never returns. Orphaned bash.exe / /usr/bin/bash processes are left behind (they inherit the stdio pipes, so the calling shell blocks on EOF rather than exiting).

0xC0000142 is STATUS_DLL_INIT_FAILED — the process could not be created/initialised, i.e. Windows-side process/session resource exhaustion, not an adapter or skill problem.

Root cause

scripts/lib/srp-engine.py --all loops skills (81) outer and adapters (19) inner and calls dispatch_to_adapter for each pair:

proc = subprocess.Popen([resolve_bash(), adapter_path], stdin=PIPE, stdout=PIPE, stderr=PIPE)

That is 81 × 19 = 1,539 bash processes. Every stdin-driven adapter then parses the IR with three jq calls (IR_NAME, IR_DESCRIPTION, IR_BODY), plus echo/sed subshells — roughly 10,000+ process creations in total, all from one Python process.

Evidence it is volume, not the code

  • The same engine, driven one skill per process (for f in skills/*/SKILL.md; do python3 scripts/lib/srp-engine.py "$f"; done), completes 81/81 skills, 0 failures. Each of those 81 parents spawns only 19 children — the same per-parent fan-out that succeeds.
  • A single --all run (one parent, 1,539 children) fails.
  • No adapter spawns background children (nohup/disown/setsid/& — none), and dispatch_to_adapter waits and closes its pipes, so this is OS process pressure from the sheer count, not an adapter leak.

Impact

bin/setup.js always runs bash scripts/sync-skills.sh --distribute-only, so this affects every end-user install. Most machines complete it, but constrained Windows sessions (low process cap, AV interference, MSYS fork pressure) fail and hang. It is also simply wasteful: rendering is ~25s of real work spread across ~10k process spawns.

Proposed fix

Render all skills through one bash per adapter instead of one bash per skill×adapter:

  • srp-engine.py --all parses every skill once and writes a single NUL-delimited IR stream (name, description, model, body, pi body).
  • A small driver sources one adapter and calls its render_skill() in a loop, so the exact same rendering code runs in-process and the per-adapter jq calls disappear.
  • Adapters without a stdin entrypoint (continue, omp, zed) remain no-ops, matching today's behaviour.
  • On any render_skill failure the driver exits non-zero and the engine aborts — no hang.

Result: ~1,539 bash + ~4,600 jq → 19 bash + 0 jq, with byte-identical generated artifacts.

Refs #135, #137 (same Windows setup area, different layer).

Activity

  1. github-actions commented on Oct 25, 2026

    @github-actions

    🎉 This issue has been resolved in version 2.88.11 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

  2. added a commit that references this issue on Oct 28, 2026
    1b56463
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions