Skip to content

feat(engine): same-project parallel task selection — round-robin fill#199

Merged
unohee merged 1 commit into
mainfrom
feat/int-2318-same-project-parallel
Jul 2, 2026
Merged

feat(engine): same-project parallel task selection — round-robin fill#199
unohee merged 1 commit into
mainfrom
feat/int-2318-same-project-parallel

Conversation

@unohee

@unohee unohee commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Only one agent ever ran per project (INT-2318). The serializer was not the scheduler — same-project concurrency has been supported under worktree isolation since INT-1975 (allowSameProjectConcurrent, default on) — but the DecisionEngine's hard one-task-per-project rule in heartbeat selection. Its justifying comment was stale, and it kept the heartbeat's KG file-conflict detection (group.length > 1 branch) permanently dead.

  • Selection extracted to the pure selectTasksRoundRobin and made round-robin across projects: every pass adds at most one task per project (fairness preserved — no project monopolizes slots); with sameProjectParallel, later passes fill remaining slots from the same projects
  • Flag wired from allowSameProjectConcurrent && worktreeMode — selection only outpaces one-per-project when the scheduler can actually run those tasks concurrently
  • File-overlapping tasks within a project are still deferred by the existing knowledge-graph conflict detection (that code path now actually runs)

Verification

6 new unit tests (off/on ordering, maxTasks, skip accounting, no-retry of failed mappings, project-key fallback) · full suite 1398 passed · oxlint 0 · tsc clean

🤖 Generated with Claude Code

… (INT-2318)

Only one agent ever ran per project. The serializer was not the scheduler
(same-project concurrency has been supported under worktree isolation
since INT-1975, default on) but the DecisionEngine's hard one-task-per-
project rule in heartbeat selection — its justifying comment ('the
scheduler runs at most one worker per project') was stale, and it kept
the heartbeat's KG file-conflict detection (group.length > 1 branch)
permanently dead.

Selection is now round-robin across projects (extracted to the pure,
unit-tested selectTasksRoundRobin): every pass adds at most one task per
project, so no project can monopolize the slots; with sameProjectParallel
later passes fill the remaining slots from the same projects. The flag is
wired from allowSameProjectConcurrent && worktreeMode — selection only
outpaces one-per-project when the scheduler can actually run those tasks
concurrently. File-overlapping tasks within a project are still deferred
by the existing knowledge-graph conflict detection.

Full suite 1398 passed, lint 0, tsc clean.
@unohee unohee merged commit 561b1d7 into main Jul 2, 2026
9 checks passed
@unohee unohee deleted the feat/int-2318-same-project-parallel branch July 2, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant