Skip to content

fix(github): report total inline suggestion fallback failure - #3232

Merged
IsmaelMartinez merged 1 commit into
The-PR-Agent:mainfrom
yashaskn8:fix/3223-github-suggestion-fallback
Sep 9, 2026
Merged

IsmaelMartinez merged 1 commit into
The-PR-Agent:mainfrom
yashaskn8:fix/3223-github-suggestion-fallback

Conversation

@yashaskn8

Copy link
Copy Markdown
Contributor

Title

fix(github): report total inline suggestion fallback failure

Description

Fixes #3223

Summary

Fix GitHub code-suggestion publication reporting when the initial batch review fails with HTTP 422 and the verification fallback drops every comment.

Previously, GithubProvider.publish_code_suggestions() returned True whenever publish_inline_comments() completed without raising, even if the 422 fallback ultimately published zero comments. This caused PRCodeSuggestions to treat the run as successful and skip its existing retry path.

Changes

  • Track the number of comments actually published by _publish_inline_comments_fallback_with_verification().
  • Return False when the 422 fallback publishes zero comments.
  • Preserve True for partial fallback success to avoid duplicate retries of suggestions that already landed.
  • Preserve successful no-op behavior for persistent inline-comment dedup when all suggestions were already posted.
  • Make publish_code_suggestions() return the actual result from publish_inline_comments() instead of unconditionally returning True.
  • Add regression tests covering total fallback failure, partial success, repaired-comment success/failure, normal success, and persistent dedup-only behavior.

Scope

This change is intentionally limited to the GitHub provider.

It does not modify:

  • GitLab or other providers
  • the caller retry policy in PRCodeSuggestions
  • pre-submission validation/drop semantics
  • provider-wide publication contracts

Validation

  • tests/unittest/test_github_provider_comments.py: 39 passed
  • tests/unittest/test_inline_comment_dedup.py: 41 passed
  • GitHub fallback verification tests: 4 passed
  • Relevant PR code-suggestion tests: 170 passed
  • Ruff: passed
  • Pre-commit: passed
  • git diff --check: clean

@github-actions github-actions Bot added the bug label Sep 9, 2026
@yashaskn8

Copy link
Copy Markdown
Contributor Author

/agentic_review

@qodo-code-review

qodo-code-review Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

Sorry, something went wrong

We weren't able to complete the code review on our side. Please try again manually by commenting /agentic_review on this PR.

Grey Divider

Qodo Logo

@IsmaelMartinez IsmaelMartinez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, and threading a real count back through the fallback is the right shape: the caller can now tell "nothing to do" from "everything failed", which is what made the old unconditional True misleading.

Suite 4389 to 4395, and the revert probe is red at 3 failed and 36 passed. #3219 does the same for CodeCommit and Gerrit, so the two together close the family.

@IsmaelMartinez
IsmaelMartinez merged commit 8bd1532 into The-PR-Agent:main Sep 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub publish_code_suggestions reports success when the 422 fallback drops every comment

2 participants