Skip to content

Regression: review dispatch bypasses max_in_progress_per_profile #78123

Description

@davidsolc-ai

Bug

_dispatch_once_locked() applies max_in_progress_per_profile to ready-task dispatch, but its later review-task spawn loop does not check or update the per-profile running counter.

Pinned revision reproduced: bc6d86b15c1d3136ee6e56275ffb1d3ff282f943 (Hermes Agent v0.20.0 / 2026.8.3).

Reproduction

  1. On one disposable board, seed three ready tasks assigned to Luna.
  2. Seed six review tasks assigned to Luna and eligible for review dispatch.
  3. Call real dispatch with max_in_progress = 9 and max_in_progress_per_profile = 3 using a no-process spawn_fn.

Expected: at most three Luna workers total.

Actual: nine Luna workers spawn—three ready plus six review—with no per-profile-cap skips for the review tasks.

Impact

The per-profile setting is not a true assignee ceiling. Review-heavy boards can exceed profile resource/provider limits and invalidate scheduler/cgroup capacity assumptions.

Suggested direction

Use one shared per-profile accounting path for ready, review, retry, and every other spawn source. Increment it after every successful/predicted spawn and apply it to existing running tasks. Add a regression test mixing existing running, ready, and review tasks for one profile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/cronCron scheduler and job managementtype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions