Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(jiuwenclaw): Fix the issue where the agent's reply is not displayed in the conversation history

cycong_1503a028acb6a
diff --git a/jiuwenclaw/agentserver/deep_agent/interface_deep.py b/jiuwenclaw/agentserver/deep_agent/interface_deep.py
index 9c8b8063d0..0ce2ee263f 100644
--- a/jiuwenclaw/agentserver/deep_agent/interface_deep.py
+++ b/jiuwenclaw/agentserver/deep_agent/interface_deep.py
@@ -2063,6 +2063,14 @@ class JiuWenClawDeepAdapter:
)
accumulated_reasoning = ""
if has_streamed_content:
+ parsed = self._parse_stream_chunk(chunk, _has_streamed_content=True)
+ if parsed is not None:
+ yield AgentResponseChunk(
+ request_id=rid,
+ channel_id=cid,
+ payload=parsed,
+ is_complete=False,
+ )
continue
parsed = self._parse_stream_chunk(chunk)
if parsed is not None:
@@ -2259,7 +2267,7 @@ class JiuWenClawDeepAdapter:
is_chunked = False
if _has_streamed_content and not is_chunked:
- return {"event_type": "chat.final", "content": ""}
+ return {"event_type": "chat.final", "content": content}
if not content:
return None