Keep a worker's shells that run a busy tool, name the shell's real command and fix the review's prose findings

This commit is contained in:
2026-11-18 17:20:13 +01:00
parent 72ffb9f748
commit abae3a0559
8 changed files with 96 additions and 50 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ class StreamingClaude:
self.proc = subprocess.Popen(["claude", *args], cwd=cwd, env={**os.environ, **env}, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, bufsize=0)
def lines(self, idle: float) -> typing.Iterable[str | None]:
# Reads the pipe's file descriptor itself, since select cannot see what a buffered reader holds, and a thread blocked in a read keeps the pipe from closing when a Ctrl-C ends the loop.
# Reads the pipe's file descriptor itself. select cannot see what a buffered reader holds.
# A thread blocked in a read would keep the pipe from closing when a Ctrl-C ends the loop.
pending = b""
with self.proc:
fd = self.proc.stdout.fileno() if self.proc.stdout else -1