fix(exec): uncap config exec timeout; 0 means no limit (#3595)

This commit is contained in:
04cb
2026-05-23 17:32:59 +08:00
committed by Xubin Ren
parent 5937236f9d
commit 5b71f61f55
3 changed files with 43 additions and 7 deletions
+4 -3
View File
@@ -53,14 +53,15 @@ class _ExecSession:
process: asyncio.subprocess.Process,
command: str,
cwd: str,
timeout: int,
timeout: int | None,
) -> None:
self.session_id = session_id
self.process = process
self.command = command
self.cwd = cwd
self.started_at = time.monotonic()
self.deadline = time.monotonic() + timeout
# timeout None/0 means no limit; an infinite deadline is never reached.
self.deadline = time.monotonic() + timeout if timeout else float("inf")
self.last_access = time.monotonic()
self._chunks: list[str] = []
self._lock = asyncio.Lock()
@@ -169,7 +170,7 @@ class ExecSessionManager:
command: str,
cwd: str,
env: dict[str, str],
timeout: int,
timeout: int | None,
shell_program: str | None,
login: bool,
yield_time_ms: int,