All subprocess.run calls to the claude CLI in agent.py (lines 22-25, 125-128, 168-171) have no timeout set. If the CLI hangs (network issue, API outage, infinite loop), the bot's event loop will block indefinitely on these synchronous calls, making the entire bot unresponsive since they run in the main thread.
Similarly, worker.py uses asyncio.create_subprocess_exec (line 57) with await proc.wait() and no timeout — a hung Claude process will block that task forever.
Fix: Add timeout=600 (or configurable) to all subprocess.run calls in agent.py. For the async subprocess in worker.py, use asyncio.wait_for(proc.wait(), timeout=...) and kill the process on timeout. Also consider running the synchronous subprocess.run calls in agent.py via asyncio.to_thread() to avoid blocking the event loop.
Identified by minbot code review
All
subprocess.runcalls to theclaudeCLI inagent.py(lines 22-25, 125-128, 168-171) have no timeout set. If the CLI hangs (network issue, API outage, infinite loop), the bot's event loop will block indefinitely on these synchronous calls, making the entire bot unresponsive since they run in the main thread.Similarly,
worker.pyusesasyncio.create_subprocess_exec(line 57) withawait proc.wait()and no timeout — a hung Claude process will block that task forever.Fix: Add
timeout=600(or configurable) to allsubprocess.runcalls inagent.py. For the async subprocess inworker.py, useasyncio.wait_for(proc.wait(), timeout=...)and kill the process on timeout. Also consider running the synchronoussubprocess.runcalls inagent.pyviaasyncio.to_thread()to avoid blocking the event loop.Identified by minbot code review