fix(auto-fix): guard create-pr endpoint against review-comment tickets#946
Merged
alex-alecu merged 2 commits intomainfrom Mar 9, 2026
Merged
fix(auto-fix): guard create-pr endpoint against review-comment tickets#946alex-alecu merged 2 commits intomainfrom
alex-alecu merged 2 commits intomainfrom
Conversation
… tickets The create-pr endpoint was being called by cloud-agent-next for review-comment tickets, bypassing the pr-callback route that correctly routes them to handleCommentReply. This caused duplicate notifications: a proper reply on the review thread plus a spurious issue-level comment on the PR main thread. Add a review_comment_id guard (rejects with 400) and a terminal-state check (returns early) so the endpoint can no longer interfere with tickets already handled by pr-callback.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
|
eshurakov
approved these changes
Mar 9, 2026
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
When
@kilo fix itis used on a review comment, cloud-agent-next calls both/api/internal/auto-fix/pr-callback(the correct path) and the legacy/api/internal/auto-fix/create-prendpoint. Thepr-callbackroute correctly posts the result on the review thread, butcreate-prhad no guards — it would also try to create a PR and post an issue-level comment on the PR main thread, causing duplicate notifications.Confirmed via Axiom logs on PR #927:
pr-callbackhandled the failure at 13:36:28, thencreate-prfired at 13:36:33 and posted a spurious "Auto-Fix Update" comment on the PR main thread.This adds two guards to the
create-prendpoint:review_comment_id, return 400 (these tickets belong inpr-callback→handleCommentReply).Verification
pnpm typecheck— passesprettier --write— no changes neededeslint— no warnings or errorsVisual Changes
N/A
Reviewer Notes
The
create-prendpoint appears to be legacy — no code in the current orchestrator constructs its URL. It's called by cloud-agent-next externally. Even if that external call is eventually removed, these guards are cheap insurance against the same class of bug.