Fix variable reference.

This commit is contained in:
user 2024-12-26 07:08:28 -05:00
parent 408eff73a9
commit 8018bce252
1 changed files with 1 additions and 1 deletions

View File

@ -459,12 +459,12 @@ def run_agent_with_retry(agent, prompt: str, config: dict) -> Optional[str]:
with InterruptibleSection():
try:
logger.debug("Attempt %d/%d", attempt + 1, max_retries)
# Track agent execution depth
current_depth = _global_memory.get('agent_depth', 0)
_global_memory['agent_depth'] = current_depth + 1
for attempt in range(max_retries):
logger.debug("Attempt %d/%d", attempt + 1, max_retries)
check_interrupt()
try:
for chunk in agent.stream({"messages": [HumanMessage(content=prompt)]}, config):