Repository navigation
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental rewrite claims and dispatches one pending ticket at a time under the per-owner advisory lock, and the previously flagged Files Reviewed (2 files)
Previous Review Summaries (4 snapshots, latest commit ad204d0)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit ad204d0)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change widens Files Reviewed (1 file)
Previous review (commit 4a82abf)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe attempted fix for the Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (1 incremental file)
Fix these issues in Kilo Cloud Previous review (commit f476574)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe stale- Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit d85eda5)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe per-owner advisory lock plus status-conditional claim is sound; the only finding is that a failed dispatch returns the ticket to Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (3 files)
Reviewed by deepseek-v4.1-flash · Input: 54.9K · Output: 9.7K · Cached: 536.8K Review guidance: REVIEW.md from base branch |
|
bot: Fixed: the failed-dispatch reset now clears started_at (and the helper accepts a null timestamp), so a ticket returned to 'pending' no longer renders as started. Tests updated and green. |
Each pending ticket is claimed in its own lock-serialized transaction immediately before its dispatch call, so the active-ticket budget is re-read on every claim and a pass only ever holds the reservation it is dispatching. A ticket returned to 'pending' after a dispatch error carries no persisted error message, so a later successful dispatch renders clean.
|
bot: The auto-triage subsystem this branch changes was removed from |
Pull request was closed
Change
Pending auto-triage ticket dispatch now claims and dispatches tickets one at a time:
claimNextPendingTicketreads the owner's active count, selects the oldest pending ticket, and moves it to 'analyzing' inside one transaction serialized by a per-owner advisory lock (pg_advisory_xact_lock, namespaced with a feature key as other owner-scoped paths do). Every claim re-reads the count, so the per-owner ceiling stays authoritative across overlapping triggers.dispatchTicketruns only for the ticket just claimed.updateTriageTicketStatusaccepts an optionalexpectedStatusthat restricts the update to rows still in that state.Verification
apps/web/src/lib/auto-triage/dispatch/dispatch-pending-tickets.test.ts(7 tests, DB-backed against the migrated per-worker test database). Concurrent calls process disjoint ticket sets covering all pending tickets, dispatch volume stays within the per-owner limit, no slots are used when the owner is at the limit, each dispatch observes at most one claimed ticket, a failed dispatch returns the ticket to 'pending' with no error message and a later pass dispatches it, and the optional expected-status restriction is exercised. All pass:cd apps/web && NODE_ENV=test npx jest src/lib/auto-triage/— 3 suites, 12 tests, green.pnpm --filter web run typecheck(trpc build + tsgo): exit 0.pnpm --filter web run lint: 0 warnings, 0 errors.pnpm -w exec oxfmton the touched files: no differences.Proxy answers
Answer: Claim + lock (Recommended)
Confidence: 0.90 · Precedent: Fix the root cause and the class of the issue: 'fix class of issue preventing progress' (7f3470e0ba6f). Only lock plus claim closes both the duplicate flip and the cap overrun, and it matches the brief and the sibling pattern.
Answer: Reset to pending on failure
Confidence: 0.70 · Precedent: Never accept 'blocked' as an end state: 'a work item must converge' (2f71af3a787e). The brief requires a failed claim to go back to 'pending' or to the existing failure status. A ticket stranded in 'analyzing' never converges. Use the existing failure status where that path already applies, and reset to pending otherwise.
Answer: Yes, optional expectedStatus (Recommended)
Confidence: 0.75 · Precedent: Fix the class, not the single symptom: 'if anything repeats the same mistake over and over again, fix the class' (00eb2a1d3e4b). The brief asks for the guard explicitly, mirroring interruptTriageTicket.