feat: wire lifecycle reactions to notifier for push-not-pull PR reviews#130
feat: wire lifecycle reactions to notifier for push-not-pull PR reviews#130AgentWrapper wants to merge 1 commit intomainfrom
Conversation
Add automated review comment detection to the lifecycle polling loop. When unresolved review comments appear on a PR, the lifecycle manager transitions to `review_comments_unresolved` status and triggers the `review-comments` reaction (sends fix instructions to the agent). Key changes: - New `review_comments_unresolved` session status with full type support - Review comment detection in `determineStatus()` with dedup via `reviewCommentsSeen` metadata field (comma-separated comment IDs) - `pendingCommentsCache` avoids redundant API calls within a poll cycle - Re-triggers reaction when new comments appear on already-unresolved PRs - Blocks `mergeable` status when pending comments exist - New `ao lifecycle start/check` CLI commands for polling management - Deprecation notice on `ao review-check` (still functional) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| // Update seen-tracking for comment dedup | ||
| const currentCommentIds = pendingComments.map((c) => c.id).join(","); | ||
| const seenIds = session.metadata?.["reviewCommentsSeen"] || ""; | ||
| if (currentCommentIds !== seenIds) { |
There was a problem hiding this comment.
Order-dependent comment ID comparison breaks dedup logic
Medium Severity
The comment dedup mechanism builds currentCommentIds via pendingComments.map((c) => c.id).join(",") without sorting the IDs first. The GitHub GraphQL API does not guarantee a stable ordering for reviewThreads, and the filter step (removing resolved/bot threads) can further change relative ordering between polls. When the same set of unresolved comments is returned in a different order, the joined string differs from the saved reviewCommentsSeen value, causing a false "new comments" detection. This triggers unnecessary metadata writes and — in the re-trigger block — sends duplicate fix instructions to the agent, defeating the dedup design.


Summary
review_comments_unresolvedstatus and triggers thereview-commentsreaction (sends fix instructions to the agent automatically)mergeablestatus when there are pending review commentsao lifecycle start/checkCLI commands replace manualao review-checkpollingChanges
Core types (
types.ts):review_comments_unresolvedsession statusreviewCommentsSeenfield onSessionMetadatafor dedup trackingLifecycle manager (
lifecycle-manager.ts):determineStatus()now callsgetPendingComments()and tracks seen comment IDspendingCommentsCacheMap avoids redundant API calls within a single poll cyclereview_comments_unresolvedmergeablestatus when pending comments exist (approved + green CI but unresolved threads)Config (
config.ts):review-commentsdefault reaction: auto send-to-agent, 2 retries, escalates after 30mCLI:
ao lifecycle start(foreground polling) andao lifecycle check <session>commandsao review-check(still functional)Replaces
Replaces #63 (closed due to conflicts with #58 hash-based metadata architecture). Clean re-implementation on current main.
Test plan
Generated with Claude Code