From 36e352afa73ba13a488405cc1d51d90092ae4103 Mon Sep 17 00:00:00 2001 From: MRHwick Date: Fri, 24 Apr 2026 14:16:09 -0400 Subject: [PATCH] preserve the original comment --- run_agent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run_agent.py b/run_agent.py index 1372def27..e5f070f9c 100644 --- a/run_agent.py +++ b/run_agent.py @@ -3308,6 +3308,10 @@ class AIAgent: # (for example Hindsight) that own their own network clients. # Explicitly stop those providers before closing the agent so # their aiohttp sessions do not leak until GC/process exit. + # Then close all remaining resources (httpx client, + # subprocesses, etc.) so GC doesn't try to clean them up on a + # dead asyncio event loop (which produces "Event loop is + # closed" errors). if review_agent is not None: try: review_agent.shutdown_memory_provider()