Skip to content

Increase recursion limit to 100 and stop retrying on GraphRecursionError#6229

Merged
suhaibmujahid merged 2 commits into
mozilla:masterfrom
suhaibmujahid:worktree-recursion-limit-no-retry
Jun 23, 2026
Merged

Increase recursion limit to 100 and stop retrying on GraphRecursionError#6229
suhaibmujahid merged 2 commits into
mozilla:masterfrom
suhaibmujahid:worktree-recursion-limit-no-retry

Conversation

@suhaibmujahid

Copy link
Copy Markdown
Member

Adds RecursionLimitError to core exceptions, raised by the agent when GraphRecursionError is hit, and caught in the API as ReviewProcessingError to prevent retries.

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.
@suhaibmujahid suhaibmujahid force-pushed the worktree-recursion-limit-no-retry branch from 7f231d7 to 916a7ef Compare June 23, 2026 15:33
@suhaibmujahid suhaibmujahid enabled auto-merge (squash) June 23, 2026 15:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_limit used by the code-review agent from 50 to 100.
  • Introduce RecursionLimitError in core exceptions and raise it when GraphRecursionError occurs.
  • Catch RecursionLimitError in the Review Helper API and convert it into ReviewProcessingError to 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.

Comment thread services/reviewhelper-api/app/review_processor.py Outdated
@marco-c

marco-c commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

This was done in #6228 too, do you want to land independently or we just land that one instead and close this?

@padenot

padenot commented Jun 23, 2026

Copy link
Copy Markdown
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>
@suhaibmujahid suhaibmujahid disabled auto-merge June 23, 2026 15:39
@suhaibmujahid suhaibmujahid enabled auto-merge (squash) June 23, 2026 15:39
@suhaibmujahid suhaibmujahid merged commit a27857a into mozilla:master Jun 23, 2026
6 checks passed
@suhaibmujahid suhaibmujahid deleted the worktree-recursion-limit-no-retry branch June 23, 2026 16:21
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.

4 participants