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(agent-teams): filter non-leader __interaction__ from frontend stream

zhanglongmin0aaf7f26de6a
diff --git a/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py b/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py
index e5b5486968..cffebb7b3f 100644
--- a/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py
+++ b/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py
@@ -1012,6 +1012,11 @@ async def _consume_stream_with_query(
if parsed is not None:
if _is_duplicate_ask_user_question(parsed, emitted_ask_user_request_ids):
continue
+ # Skip non-leader __interaction__ (permission ASK) — approval
+ # is routed internally via the leader; only leader
+ # interactions are forwarded to the frontend.
+ if not is_leader and parsed.get("event_type") == "chat.ask_user_question":
+ continue
parsed["rid"] = round_id
if is_teammate:
parsed = _enrich_teammate_event(parsed, chunk)