fix(exec): retain process trees after root exit

This commit is contained in:
chengyongru authored and chengyongru committed 2026-08-12 14:37:27 +08:00
1 parent d64b84604c
commit bcf5d8a6ed
5 files changed
+411 -43

No files matched your search

+5 -1
View File
@@ -209,7 +209,11 @@ class _ExecSession:
timeout=2.0,
)
# Safety-net reap after normal exit.
from nanobot.agent.tools.shell import _reap_pid # pyright: ignore[reportPrivateUsage]
from nanobot.agent.tools.shell import ( # pyright: ignore[reportPrivateUsage]
ExecTool,
_reap_pid, # pyright: ignore[reportPrivateUsage]
)
ExecTool._release_process_tree(self.process) # pyright: ignore[reportPrivateUsage]
_reap_pid(self.process.pid) # pyright: ignore[reportPrivateUsage]
elif yield_time_ms > 0:
await self._wait_for_buffered_output()