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"])