Increase recursion limit to 100 and stop retrying on GraphRecursionError#6229
Merged
suhaibmujahid merged 2 commits intoJun 23, 2026
Merged
Conversation
Adds RecursionLimitError to core exceptions, raised by the agent when GraphRecursionError is hit, and caught in the API as ReviewProcessingError to prevent costly Cloud Tasks retries.
7f231d7 to
916a7ef
Compare
There was a problem hiding this comment.
Pull request overview
Updates the code-review agent and Review Helper API to treat LangGraph recursion-limit failures as non-retryable, while also increasing the agent’s recursion limit to allow more complex reviews to complete.
Changes:
- Increase the LangGraph
recursion_limitused by the code-review agent from 50 to 100. - Introduce
RecursionLimitErrorin core exceptions and raise it whenGraphRecursionErroroccurs. - Catch
RecursionLimitErrorin the Review Helper API and convert it intoReviewProcessingErrorto prevent Cloud Tasks retries.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| services/reviewhelper-api/app/review_processor.py | Catch RecursionLimitError and convert to permanent ReviewProcessingError to stop retries. |
| bugbug/tools/core/exceptions.py | Add RecursionLimitError to core exception types. |
| bugbug/tools/code_review/agent.py | Increase recursion limit and map GraphRecursionError to RecursionLimitError. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
This was done in #6228 too, do you want to land independently or we just land that one instead and close this? |
Collaborator
|
I'll drop mine from the stack, this should land separately asap. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
marco-c
approved these changes
Jun 23, 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.
Adds RecursionLimitError to core exceptions, raised by the agent when GraphRecursionError is hit, and caught in the API as ReviewProcessingError to prevent retries.