Log OpenCode tool execution steps in real time in voice assistant console

This commit is contained in:
Adolfo Reyna
2026-08-07 19:32:25 -04:00
parent 1386615c49
commit f0be1a8cdf
+12
View File
@@ -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.")