diff --git a/src/agenthub/channels/wecom.py b/src/agenthub/channels/wecom.py index d3bfd03..70d5981 100644 --- a/src/agenthub/channels/wecom.py +++ b/src/agenthub/channels/wecom.py @@ -287,7 +287,13 @@ class WecomAibotChannel: elif kind == "delta": self._stream_append(chat_id, str(payload.get("text", ""))) elif kind == "status": - self._stream_ensure(chat_id, str(payload.get("text", ""))) + if payload.get("close_stream"): + # queued follow-up ack: the "正在处理…" bubble from this + # message's own ack would otherwise hang forever (a queued + # message never produces a final) — close it out instead. + self._stream_close(chat_id, str(payload.get("text", ""))) + else: + self._stream_ensure(chat_id, str(payload.get("text", ""))) elif kind == "tool_start": # show agent progress inside the stream bubble so long tool turns # don't look stuck diff --git a/src/agenthub/session.py b/src/agenthub/session.py index 5de30f7..0ed5ffb 100644 --- a/src/agenthub/session.py +++ b/src/agenthub/session.py @@ -381,7 +381,8 @@ class SessionManager: "text": text, "images": images or [], "files": files or [], }) key = f"{channel}:{chat_id}" - self._emit(key, "status", {"text": "已收到,将在当前回答结束后作为补充追加给 agent。"}) + self._emit(key, "status", {"text": "已收到,将在当前回答结束后作为补充追加给 agent。", + "close_stream": True}) log.info(f"[{key}] follow-up queued mid-turn ({len(text)} chars)") return {"queued": True, "session_id": None, "agent": None} try: