Skip to content

perf(task-board): enqueue enabled reviewers concurrently - #5541

Merged
pedrofrxncx merged 1 commit into
mainfrom
perf/parallel-reviewer-enqueue-w2
Aug 1, 2026
Merged

pedrofrxncx merged 1 commit into
mainfrom
perf/parallel-reviewer-enqueue-w2

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator

Follows #5520 (QA Agent + Code Reviewer review flow).

enqueueEnabledReviewers looped over the org's enabled reviewer kinds (qa, code_review) and awaited each one's claimReviewer + enqueueReviewerForTask sequentially, even though the two are fully independent — each claim is its own DB row keyed by (task, reviewer, cycle), and each enqueue creates its own thread/dispatch. This function is called synchronously from TASK_BOARD_ITEM_PRS_GET's handler (the board's 10s poll), so with both reviewers enabled — the default shape after #5520 — every poll that triggers the hand-off paid two full claim+thread-create+dispatch round-trips back to back instead of one.

Change: run the per-reviewer work via Promise.all instead of a for...await loop. Behavior is unchanged — each reviewer's claim/enqueue/error-handling is identical, just concurrent instead of serial; no shared mutable state between iterations (each writes to its own claim row and its own thread).

How to verify: cd apps/api && bunx tsc --noEmit and bunx oxlint apps/api/src/tools/task-board/enqueue-reviewer.ts (both clean). No behavior change to unit-test — enqueue-reviewer.test.ts's existing coverage of reviewerHandledThisCycle (the pure guard this loop calls) is untouched and still passes. Full CI validates the rest.

Locally ran: bun run fmt, cd apps/api && bunx tsc --noEmit, bunx oxlint apps/api/src/tools/task-board/enqueue-reviewer.ts.


Summary by cubic

Run QA and Code Reviewer enqueueing in parallel to reduce task board poll latency. Behavior is unchanged; each reviewer still claims and enqueues independently.

  • Refactors
    • Use Promise.all in enqueueEnabledReviewers to run per-reviewer claim+enqueue concurrently, reducing TASK_BOARD_ITEM_PRS_GET poll path latency.
    • Keep the same claim token flow and error handling; each reviewer writes to its own (task, reviewer, cycle) row.

Written for commit 52a26b4. Summary will update on new commits.

Review in cubic

enqueueEnabledReviewers awaited each reviewer's claim+enqueue
sequentially, even though QA and Code Reviewer are independent DB rows
keyed by their own kind. This runs on TASK_BOARD_ITEM_PRS_GET's
synchronous 10s-poll path, so with both reviewers enabled (shipped in
#5520) the round-trip serialized two full claim+thread-create+dispatch
chains back to back.
@pedrofrxncx
pedrofrxncx merged commit 50d3139 into main Aug 1, 2026
26 checks passed
@pedrofrxncx
pedrofrxncx deleted the perf/parallel-reviewer-enqueue-w2 branch August 1, 2026 03:59
decocms Bot pushed a commit that referenced this pull request Aug 1, 2026
PR: #5541 perf(task-board): enqueue enabled reviewers concurrently
Bump type: patch

- decocms (apps/api/package.json): 4.158.4 -> 4.158.5
- @decocms/native (apps/native/package.json): 4.158.4 -> 4.158.5

Deploy-Scope: server
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