fix(router): review agent trigger resilience and ack ordering#640
Merged
zbigniewsobiecki merged 1 commit intodevfrom Mar 7, 2026
Merged
fix(router): review agent trigger resilience and ack ordering#640zbigniewsobiecki merged 1 commit intodevfrom
zbigniewsobiecki merged 1 commit intodevfrom
Conversation
Three bugs caused the review agent to silently not run on PR#425: 1. Check polling window too short — `waitForChecks` polled 5×10s = 50s max, but CI took ~60s. Increase MAX_RETRIES from 5 to 12 (120s window). 2. Orphaned ack comment — when `pollWaitForChecks` returns false the handler returned without cleaning up the "👀 Reviewing" ack comment, leaving a misleading message on the PR. Now deletes the ack comment before returning. 3. Ack posted before job enqueued — the router posted the ack comment (step 8) before calling `addJob()` (step 9). A router crash between them orphans the ack with no corresponding job. Swap the ordering: enqueue first (durable in Redis), then post ack and patch the ackCommentId onto the job via `updateData()`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes three bugs that caused the review agent to silently not run on llmist PR#425:
waitForCheckspolled 5×10s = 50s max, but CI took ~60s after the first webhook. IncreasedMAX_RETRIESfrom 5 → 12 (120s total polling window)pollWaitForChecksreturned false, the handler silently returned without cleaning up the "👀 Reviewing" comment, leaving a misleading message on the PR. Now deletes the ack comment before returningaddJob()(step 9). A router crash between them orphans the ack with no corresponding job. Reordered: enqueue first (durable in Redis), then post ack and patchackCommentIdonto the job viaupdateData()Changes
src/triggers/github/check-suite-success.tsMAX_RETRIES5 → 12src/triggers/github/webhook-handler.tswaitForChecksfailuresrc/router/webhook-processor.tssrc/router/platform-adapter.tsackCommentId/ackMessagefrombuildJobsignaturesrc/router/adapters/github.tsbuildJob— no ack paramssrc/router/adapters/trello.tsbuildJob— no ack paramssrc/router/adapters/jira.tsbuildJob— no ack paramsTest plan
npm test— 3963 tests pass (234 files)npm run lint— cleannpm run typecheck— cleanwebhook-processorenqueues before posting ack (call order assertion)webhook-processorpatches ack info viaupdateDataafter ackwebhook-handlerdeletes ack comment whenpollWaitForChecksreturns falsewebhook-handlerskips deletion when noackCommentIdpresentbuildJobtests updated for new signature (github, trello, jira)🤖 Generated with Claude Code