From f0be1a8cdfaebdd503c77d424f1e073da3b9dfc5 Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Fri, 7 Aug 2026 19:32:25 -0400 Subject: [PATCH] Log OpenCode tool execution steps in real time in voice assistant console --- opencode_llm.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/opencode_llm.py b/opencode_llm.py index adc2424..bd044dc 100644 --- a/opencode_llm.py +++ b/opencode_llm.py @@ -168,6 +168,17 @@ class OpenCodeLLM(FrameProcessor): cwd=str(self._cwd), ) + async def _read_stderr(stream): + while True: + line = await stream.readline() + if not line: + break + decoded = line.decode("utf-8").strip() + if decoded and not decoded.startswith(">"): + logger.info(f"OpenCode Tool: {decoded}") + + stderr_task = asyncio.create_task(_read_stderr(proc.stderr)) + while True: line = await proc.stdout.readline() if not line: @@ -179,6 +190,7 @@ class OpenCodeLLM(FrameProcessor): await self.push_frame(LLMTextFrame(cleaned)) await proc.wait() + await stderr_task except asyncio.CancelledError: logger.info("OpenCode turn cancelled mid-response.")