This commit is contained in:
Timothy Jaeryang Baek committed 2026-08-05 01:59:39 -05:00
1 parent 034f35bcb9
commit 1516924e99
4 files changed
+42 -10

No files matched your search

+15 -4
View File
@@ -190,10 +190,21 @@ class CodexAppServer:
async def _stderr_loop(self) -> None:
assert self.proc is not None and self.proc.stderr is not None
while line := await self.proc.stderr.readline():
text = line.decode(errors="replace").strip()
if text:
self.stderr_tail.append(text[:2000])
while True:
try:
line = await self.proc.stderr.readline()
except ValueError as exc:
self._append_stderr(f"stderr line too long: {exc}", truncated=True)
continue
if not line:
break
self._append_stderr(line.decode(errors="replace"))
def _append_stderr(self, text: str, *, truncated: bool = False) -> None:
text = text.strip()
if text:
suffix = " [truncated]" if truncated else ""
self.stderr_tail.append(f"{text[:2000]}{suffix}")
def _fail_pending(self, message: str) -> None:
for future in self.pending.values():