Skip to content

perf(ai): parallel async branch and pr review worker pool with semaphore concurrency #120

Closed

Description

@dan-petty

Problem Statement

Branch review for large changesets (e.g. 170+ files) currently processes files sequentially, causing review commands to run for 2.5+ hours (as observed in running terminal PID 1269366).

Proposed Changes

  • Implement an asynchronous review worker pool using Python 3.14 asyncio.TaskGroup.
  • Bound concurrency via asyncio.Semaphore(concurrency=4..8) and token bucket rate limits.
  • Enable concurrent file analysis while respecting local model inference capacity and preventing provider 429 throttling.

Acceptance Criteria

  • Multi-file branch review turnaround cut by up to 75%.
  • Bounded VRAM and token usage without triggering rate limits.
  • Clean error isolation per worker task in tests/test_ai_review.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/aitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions