Skip to content

fix: add MAX_REVISIONS guard to prevent infinite revision loop#1783

Open
varshiniml7 wants to merge 2 commits into
assafelovic:mainfrom
varshiniml7:main
Open

fix: add MAX_REVISIONS guard to prevent infinite revision loop#1783
varshiniml7 wants to merge 2 commits into
assafelovic:mainfrom
varshiniml7:main

Conversation

@varshiniml7

Copy link
Copy Markdown

Problem

The human ↔ planner revision loop in _add_workflow_edges() had no
explicit upper bound on revisions. A runaway "revise" feedback loop
would silently hit LangGraph's default recursion_limit=25, causing a
confusing GraphRecursionError with no clear signal.

Fix

Added a MAX_REVISIONS = 5 guard with a force_accept branch that
redirects to researcher after 5 revisions, preventing infinite loops.

Related Issue

Fixes #1766

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.

cycle_detection: planner ↔ human revision loop has no explicit max_revisions guard

2 participants