Skip to content

fix(pr-review): avoid false session-limit classification on retry - #60

Merged
Troublor merged 1 commit into
mainfrom
william/fix/pr-review-session-limit-classify
Nov 23, 2026
Merged

Troublor merged 1 commit into
mainfrom
william/fix/pr-review-session-limit-classify

Conversation

@Troublor

Copy link
Copy Markdown
Contributor

Summary

  • Extract quota/rate-limit signals only from error-bearing transcript records (rate_limit_event with status == "rejected", API-error assistant messages, and non-max_turns error result records) instead of walking every string in the JSON transcript. Every Claude Code session emits a routine startup rate_limit_event with status: "allowed", rateLimitType: "five_hour", and overageStatus: "rejected", which previously caused classify_model_failure to flag every first pass as MODEL_SESSION_LIMIT (retryable=False), skipping review_retry whenever the first pass ended with error_max_turns.
  • Ignore user tool results and normal assistant messages during quota classification so repository files or diffs mentioning rate limits do not trigger false positives.
  • Classify analysis-retry-transcript.json during compile when the first attempt was retryable so a real quota failure on the retry pass is still surfaced accurately.
  • Raise the fast incremental tier default turn budget from 12 to 24 (retry 36) so reading the mandatory pipeline inputs and changed files fits without exhausting the first-pass budget.

Test plan

  • PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s .github/actions/claude-pr-review -p 'test_*.py' -v
  • python3 .github/scripts/action_docs.py --check

@Troublor
Troublor merged commit 5dcd7eb into main Nov 23, 2026
14 checks passed
@Troublor
Troublor deleted the william/fix/pr-review-session-limit-classify branch November 23, 2026 11:25
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.

1 participant