Skip to content

fix(code-review): ignore stale running slots#2824

Merged
alex-alecu merged 3 commits intomainfrom
fix/code-review-stale-running-slots
Apr 28, 2026
Merged

fix(code-review): ignore stale running slots#2824
alex-alecu merged 3 commits intomainfrom
fix/code-review-stale-running-slots

Conversation

@alex-alecu
Copy link
Copy Markdown
Contributor

Summary

  • Code review dispatch now stops old stuck running reviews from using owner slots forever.
  • The existing retry path for stuck queued reviews stays the same, and stuck running reviews are not retried or changed by this fix.
  • Added coverage for the slot count rules so recent work still counts and old stuck work does not.

Verification

  1. In a local database, create an owner with recent running or queued reviews and confirm they still use slots.
  2. Add a running review older than 90 minutes and confirm dispatch no longer counts it as using a slot.
  3. Add a queued review older than 5 minutes and confirm dispatch still treats it as recoverable queued work, not active work.

Visual Changes

N/A

Reviewer Notes

Old stuck running reviews will still appear as running until a separate cleanup changes their saved state. This PR only restores dispatch capacity.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Apr 27, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.ts
  • apps/web/src/lib/code-reviews/dispatch/dispatch-pending-reviews.test.ts

Reviewed by gpt-5.4-20260305 · 1,508,489 tokens

Copy link
Copy Markdown
Contributor

@markijbema markijbema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wont this introduce the risk of people having unlimited number of endlessly running review agents? How do we know those reviews running for 90 minutes aren't actually consuming tokens?

@alex-alecu
Copy link
Copy Markdown
Contributor Author

Wont this introduce the risk of people having unlimited number of endlessly running review agents? How do we know those reviews running for 90 minutes aren't actually consuming tokens?

@markijbema I will address this in a followup PR. As said in Slack I wanted a PR that solves the imediate pain with minimal code.

@alex-alecu alex-alecu merged commit 21ec9db into main Apr 28, 2026
15 checks passed
@alex-alecu alex-alecu deleted the fix/code-review-stale-running-slots branch April 28, 2026 08:21
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.

2 participants