Krishp1 commited on
Commit
9480eea
·
verified ·
1 Parent(s): e85aa76

Update edges.py

Browse files
Files changed (1) hide show
  1. edges.py +4 -1
edges.py CHANGED
@@ -52,6 +52,9 @@ def route_after_complexity(state: State) -> str:
52
  def route_after_reflection(state: State) -> str:
53
  if state["reflection_ok"]:
54
  return "reviewer"
55
- if state["retries"] >= 3:
 
 
 
56
  return "reviewer" # ship after 3 tries
57
  return "coder"
 
52
  def route_after_reflection(state: State) -> str:
53
  if state["reflection_ok"]:
54
  return "reviewer"
55
+ # Own counter — "retries" is only incremented by the debugger node,
56
+ # which this loop never visits, so it would never advance and could
57
+ # bounce coder<->reflection until LangGraph's recursion_limit crashes.
58
+ if state.get("reflection_retries", 0) >= 3:
59
  return "reviewer" # ship after 3 tries
60
  return "coder"