From 3219fc180685d7f10370d4df13132784722a54b2 Mon Sep 17 00:00:00 2001 From: abraxas914 Date: Tue, 7 Jul 2026 16:46:03 +0800 Subject: [PATCH] fix(conductor): push error chat to frontend when LLM call fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When all LLM nodes timeout/fail, the conductor's except block only printed to stdout — users saw their message disappear with no feedback. Now broadcasts a role="error" chat item via the existing WebSocket pipeline so the frontend renders a red error bubble inline. --- frontends/conductor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontends/conductor.py b/frontends/conductor.py index 9ec04b55..ce473e2a 100644 --- a/frontends/conductor.py +++ b/frontends/conductor.py @@ -411,7 +411,9 @@ API: {base};requests,GET /readme查用法,GET /chat读未读对话,GET / _apply_desktop_model(self.agent) dq = self.agent.put_task(prompt, source="conductor") self._drain(dq, events) - except Exception as e: print(f"Conductor error: {e}") + except Exception as e: + print(f"Conductor error: {e}") + add_chat(f"⚠ 回复失败:{e}", role="error") def start(self): threading.Thread(target=self._run, name="conductor-loop", daemon=True).start()