Skip to content

refactor: Parallelize sequential getCommentReactions API calls when checking multiple comments#211

Open
frostyardyeti[bot] wants to merge 1 commit intomainfrom
yeti/improve-b678
Open

refactor: Parallelize sequential getCommentReactions API calls when checking multiple comments#211
frostyardyeti[bot] wants to merge 1 commit intomainfrom
yeti/improve-b678

Conversation

@frostyardyeti
Copy link
Copy Markdown
Contributor

@frostyardyeti frostyardyeti Bot commented Apr 1, 2026

Several jobs check reactions on comments sequentially in a loop, making one API call per comment:

  • src/jobs/issue-refiner.ts:489-503 (findUnreactedHumanComments) — iterates with for...of and awaits each getCommentReactions() call
  • src/github.ts:1142-1157 (buildIssueContext) — same sequential pattern
  • src/jobs/issue-auditor.ts:52-65 (classifyIssue) — same pattern
  • src/jobs/plan-reviewer.ts:185-194 — single call per issue (less impactful)

For issues with many human comments (5-10+), this creates unnecessary serial latency since each call is independent and already deduplicated by the TTL cache. Using Promise.all() (or a small batch like Promise.all(comments.map(...))) for the reaction checks would reduce wall-clock time proportionally to the number of comments. The findUnreactedHumanComments function in issue-refiner.ts is the best starting point since it's called on every issue scan and has the clearest loop structure.


Automated improvement by yeti improvement-identifier

Replace sequential for...of + await loops with Promise.all() for
independent reaction checks on multiple comments. This reduces
wall-clock time proportionally to the number of comments.

Parallelized locations:
- findUnreactedHumanComments in issue-refiner.ts
- classifyIssue reaction loop in issue-auditor.ts
- Both inline and issue comment reaction checks in getPRReviewComments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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