Skip to content

Your lightweight open-source personal agent.

refactor(shell): use finally block to reap zombie processes on timeoutx

Eric Yange2e1c9c27688
diff --git a/nanobot/agent/tools/shell.py b/nanobot/agent/tools/shell.py
index a69182fe5..bec189a1c 100644
--- a/nanobot/agent/tools/shell.py
+++ b/nanobot/agent/tools/shell.py
@@ -116,7 +116,7 @@ class ExecTool(Tool):
try:
os.waitpid(process.pid, os.WNOHANG)
except (ProcessLookupError, ChildProcessError):
- pass
+ logger.debug("Process already reaped or not found: {}", e)
return f"Error: Command timed out after {effective_timeout} seconds"
output_parts = []