Skip to content

bug: Concurrency limit applies per-skill, not globally across all tasks #154

@dcramer

Description

@dcramer

Problem

The [runner] concurrency setting (default: 4) controls how many skills run in parallel. But each skill also spawns up to 5 file-level workers (fileConcurrency = 5 hardcoded in cli/output/tasks.ts:539 and sdk/types.ts:12). This means with default settings, you can see up to 20 concurrent tasks (4 skills × 5 files each), and with a higher skill concurrency you can easily hit 10+ simultaneous API calls.

The concurrency setting should act as a global task limit — the total number of concurrent hunk/file analyses across all skills — not just a limit on how many skills run in parallel.

Current Behavior

[runner]
concurrency = 5   # ← controls skill-level parallelism only
  • 5 skills run in parallel
  • Each skill processes up to 5 files concurrently (hardcoded DEFAULT_FILE_CONCURRENCY = 5)
  • Actual concurrent tasks: up to 25

Expected Behavior

concurrency should be a global pool that all file/hunk analysis tasks draw from, regardless of which skill spawned them. If concurrency = 5, there should never be more than 5 active API calls at any given time.

Relevant Code

  • Skill-level concurrency: src/cli/main.ts:547, src/cli/output/tasks.ts:531-574
  • File-level concurrency (hardcoded): src/cli/output/tasks.ts:539, src/sdk/types.ts:12
  • Pool implementation: src/utils/async.ts (runPool)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions