Skip to content

fix: don't post non-actionable errors as GitHub review comments#189

Merged
tnm merged 1 commit intocased:mainfrom
JosephDoUrden:fix/114-skip-non-actionable-review-errors
Feb 27, 2026
Merged

fix: don't post non-actionable errors as GitHub review comments#189
tnm merged 1 commit intocased:mainfrom
JosephDoUrden:fix/114-skip-non-actionable-review-errors

Conversation

@JosephDoUrden
Copy link
Contributor

Summary

  • Add is_non_actionable_error() helper in src/kit/pr_review/error_utils.py to classify token-limit, context-length, HTTP 5xx, and rate-limit errors as non-actionable
  • Gate post_pr_comment() in both PRReviewer and AgenticPRReviewer so these errors are shown locally instead of posted to GitHub
  • Add 27 tests covering error classification and integration behavior

Root cause

The enhanced LLM analysis methods catch provider exceptions and return error strings (e.g. Error during enhanced LLM analysis: 502 Bad Gateway). These strings were previously treated as normal review output and blindly posted to GitHub via post_pr_comment().

Test plan

  • Unit tests for all error patterns (token limits, 5xx, rate limits, Ollama, agentic prefixes)
  • Negative tests ensuring normal reviews and non-infra errors are not suppressed
  • Integration tests verifying post_pr_comment() is NOT called for 5xx/token errors
  • Integration test verifying post_pr_comment() IS called for successful reviews
  • Existing test suite passes with no regressions

Closes #114

…d#114)

When the LLM provider returns a token-limit, context-length, HTTP 5xx,
or rate-limit error, skip posting it as a PR comment and show the error
locally instead. A centralized is_non_actionable_error() helper detects
these infrastructure failures by checking for known error prefixes
combined with provider error patterns.
@tnm tnm merged commit c81a040 into cased:main Feb 27, 2026
1 check passed
@tnm
Copy link
Contributor

tnm commented Feb 27, 2026

Good idea, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't post errors in review mode when token limits (or upstream 50x) is hit

2 participants