From af15e64e0a8e438f55d1d844efd65eacda5c6dd2 Mon Sep 17 00:00:00 2001 From: Adolfo Reyna Date: Fri, 7 Aug 2026 19:47:05 -0400 Subject: [PATCH] Restore live tool execution logging in console for OpenCode --- opencode_llm.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/opencode_llm.py b/opencode_llm.py index 4d5e9bb..70fd1f2 100644 --- a/opencode_llm.py +++ b/opencode_llm.py @@ -119,7 +119,7 @@ class OpenCodeLLM(FrameProcessor): port: int = 4096, system_prompt: str | None = None, observer=None, - use_server: bool = True, + use_server: bool = False, **kwargs, ): super().__init__(**kwargs) @@ -244,11 +244,15 @@ class OpenCodeLLM(FrameProcessor): data = await resp.json() parts = data.get("parts", []) if isinstance(data, dict) else [] for p in parts: - if isinstance(p, dict) and p.get("type") == "text" and "text" in p: - text_chunk = _clean_spoken_text(p["text"]) - if text_chunk: - chunks.append(text_chunk) - await self.push_frame(LLMTextFrame(text_chunk)) + if isinstance(p, dict): + p_type = p.get("type") + if p_type == "text" and "text" in p: + text_chunk = _clean_spoken_text(p["text"]) + if text_chunk: + chunks.append(text_chunk) + await self.push_frame(LLMTextFrame(text_chunk)) + elif p_type not in ("step-start", "step-finish"): + logger.info(f"OpenCode Tool: {p_type} -> {json.dumps(p)[:120]}") if not chunks and isinstance(data, dict): if "delta" in data: text_chunk = _clean_spoken_text(data["delta"])