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(team): close team stream on member-settle edge + unify completion paths

wade_wolzzi0cc657832a8d
diff --git a/jiuwenswarm/agents/harness/team/config_loader.py b/jiuwenswarm/agents/harness/team/config_loader.py
index a079e7ab55..e6def18ae5 100644
--- a/jiuwenswarm/agents/harness/team/config_loader.py
+++ b/jiuwenswarm/agents/harness/team/config_loader.py
@@ -715,6 +715,7 @@ def load_team_spec_dict(
spec_dict["team_name"] = str(team_raw.get("team_name") or resolved_template_id or "team").strip() or "team"
spec_dict["lifecycle"] = team_raw.get("lifecycle", "persistent")
+ spec_dict.setdefault("enable_taskless_completion", True)
spec_dict["teammate_mode"] = team_raw.get("teammate_mode", "build_mode")
spec_dict["spawn_mode"] = team_raw.get("spawn_mode", "inprocess")
spec_dict["enable_hitt"] = team_raw.get("enable_hitt", True)
diff --git a/jiuwenswarm/agents/harness/team/team_manager.py b/jiuwenswarm/agents/harness/team/team_manager.py
index a519d90a5f..a13f4af778 100644
--- a/jiuwenswarm/agents/harness/team/team_manager.py
+++ b/jiuwenswarm/agents/harness/team/team_manager.py
@@ -323,6 +323,11 @@ class TeamManager:
# is received. When True, chat.final is no longer suppressed
# even if seen_team_events is True.
self._workflow_completed: dict[str, bool] = {}
+ # session_id → True once the is_complete frame for the current round
+ # has been claimed. Lets both the edge path and the poll path
+ # (team.completed) dedup to exactly one processing_status(is_complete)
+ # broadcast per round. Reset at round start.
+ self._round_complete_emitted: dict[str, bool] = {}
def has_stream_task(self, session_id: str) -> bool:
return session_id in self._stream_tasks
@@ -390,6 +395,22 @@ class TeamManager:
"""Reset the flag at the start of a new conversation round."""
self._seen_team_events.pop(session_id, None)
+ def claim_round_complete(self, session_id: str) -> bool:
+ """Check-and-set per-round completion.
+
+ True if this call is the first to claim completion for the round
+ (caller broadcasts the is_complete frame). False if already
+ claimed (idempotent: skip the broadcast). Reset by
+ ``reset_round_complete`` at round start.
+ """
+ if self._round_complete_emitted.get(session_id):
+ return False
+ self._round_complete_emitted[session_id] = True
+ return True
+
+ def reset_round_complete(self, session_id: str) -> None:
+ self._round_complete_emitted.pop(session_id, None)
+
def mark_workflow_completed(self, session_id: str) -> None:
"""Mark that the workflow has reached a terminal status."""
self._workflow_completed[session_id] = True
diff --git a/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py b/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py
index 3af7a63b32..a981083cad 100644
--- a/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py
+++ b/jiuwenswarm/server/runtime/agent_adapter/team_helpers.py
@@ -11,7 +11,7 @@ import re
import time
from dataclasses import dataclass
from pathlib import Path
-from typing import Any, AsyncIterator
+from typing import Any, AsyncIterator, Awaitable, Callable, Optional
from openjiuwen.agent_teams.context import reset_session_id, set_session_id
from openjiuwen.agent_teams.paths import (
@@ -1195,6 +1195,32 @@ async def _team_has_unread_messages(session_id: str, handler: Any) -> bool:
reset_session_id(token)
+def _taskless_completion_enabled(session_id: str) -> bool:
+ """Read TeamSpec.enable_taskless_completion for the session's team.
+
+ Defaults True (the fixed taskless-completion behavior). False = an empty
+ task board never settles, which is the emergency rollback for the EDGE
+ path (``_team_round_settled``). Mirrors the POLL_TASK gate in agent-core
+ (``team_completion`` reads ``self._blueprint.team_spec``) so the toggle
+ rolls back BOTH trigger paths consistently when set False. Any accessor
+ miss returns True so the toggle is purely opt-in and never breaks the
+ fixed behavior on a missing/NotReady TeamAgent.
+ """
+ try:
+ tm = get_team_manager(None)
+ handler = tm.get_monitor_handler(session_id)
+ if handler is None:
+ return True
+ # handler._monitor._team_agent is the agent-core TeamAgent, which
+ # exposes ``team_spec`` (a @property -> Optional[TeamSpec]). The
+ # field is ``TeamSpec.enable_taskless_completion: bool = True``.
+ team_agent = getattr(getattr(handler, "_monitor", None), "_team_agent", None)
+ spec = getattr(team_agent, "team_spec", None)
+ return bool(getattr(spec, "enable_taskless_completion", True))
+ except Exception:
+ return True
+
+
async def _team_round_settled(channel_id: str | None, session_id: str) -> bool:
"""Return whether the DB-backed team state is safe to finish this round."""
try:
@@ -1228,6 +1254,14 @@ async def _team_round_settled(channel_id: str | None, session_id: str) -> bool:
if status not in _TEAM_TASK_TERMINAL_STATUSES:
return False
+ # Empty task board: when the toggle is disabled (rollback mode), the
+ # team must NOT settle via the edge path — faithful to the pre-fix
+ # hang. Defaults True (via _taskless_completion_enabled) so the fixed
+ # behavior is preserved on any accessor miss. Non-empty boards are
+ # unaffected (their terminal check above already gates completion).
+ if not (snapshot.get("tasks") or []) and not _taskless_completion_enabled(session_id):
+ return False
+
if await _team_has_unread_messages(session_id, handler):
return False
@@ -1251,6 +1285,45 @@ async def _team_round_settled(channel_id: str | None, session_id: str) -> bool:
return False
+async def _finish_round_if_settled(
+ channel_id: str | None,
+ session_id: str,
+ round_id: Any,
+ *,
+ reason: str,
+) -> bool:
+ """Re-evaluate _team_round_settled; on True, broadcast processing_status
+ (is_complete=True) with per-round idempotent dedup and return True so the
+ caller can break the stream loop. On False, return False (no broadcast).
+
+ The dedup (claim_round_complete) is shared with the team.completed poll
+ path so exactly one is_complete frame is emitted per round even when both
+ paths fire. claim_round_complete is sync (flag set before any await)."""
+ if not await _team_round_settled(channel_id, session_id):
+ return False
+ tm = get_team_manager(channel_id)
+ if not tm.claim_round_complete(session_id):
+ return True # already broadcast this round; idempotent
+ _broadcast_event(
+ channel_id,
+ session_id,
+ {
+ "event_type": "chat.processing_status",
+ "session_id": session_id,
+ "rid": round_id,
+ "is_processing": False,
+ "is_complete": True,
+ },
+ )
+ logger.info(
+ "[TeamHelpers] settle-close round: channel_id=%s session_id=%s reason=%s",
+ _resolve_channel_id(channel_id),
+ session_id,
+ reason,
+ )
+ return True
+
+
def _is_duplicate_ask_user_question(
parsed: dict[str, Any],
emitted_request_ids: set[str],
@@ -1887,6 +1960,7 @@ async def process_team_message_stream(
)
if not reuse_active_waiter and not _is_cron_request_id(rid):
team_manager.reset_seen_team_events(session_id)
+ team_manager.reset_round_complete(session_id)
team_manager.reset_workflow_completed(session_id)
request_queue = asyncio.Queue()
team_manager.add_waiter(session_id, rid, request_queue)
@@ -2259,6 +2333,7 @@ async def _consume_stream_with_query(
# can correctly determine whether the team is active.
tm_ = get_team_manager(channel_id)
tm_.reset_seen_team_events(session_id)
+ tm_.reset_round_complete(session_id)
tm_.reset_workflow_completed(session_id)
try:
logger.info(
@@ -2466,20 +2541,25 @@ async def _consume_stream_with_query(
continue
elif parsed.get("event_type") == "team.completed":
# Team completed this round — broadcast a single
- # round-complete signal that also carries team stats.
- _broadcast_event(
- channel_id,
- session_id,
- {
- "event_type": "chat.processing_status",
- "session_id": session_id,
- "rid": round_id,
- "is_processing": False,
- "is_complete": True,
- "member_count": parsed.get("member_count"),
- "task_count": parsed.get("task_count"),
- },
- )
+ # round-complete signal that also carries team stats,
+ # deduped per round via claim_round_complete so this poll
+ # path and the leader chat.final edge path together emit
+ # exactly one is_complete frame per round.
+ tm_ = get_team_manager(channel_id)
+ if tm_.claim_round_complete(session_id):
+ _broadcast_event(
+ channel_id,
+ session_id,
+ {
+ "event_type": "chat.processing_status",
+ "session_id": session_id,
+ "rid": round_id,
+ "is_processing": False,
+ "is_complete": True,
+ "member_count": parsed.get("member_count"),
+ "task_count": parsed.get("task_count"),
+ },
+ )
continue
elif parsed.get("event_type") == "chat.error":
_broadcast_event(channel_id, session_id, parsed)
@@ -2506,37 +2586,30 @@ async def _consume_stream_with_query(
# workflow_completed stays False so the original behavior
# is preserved.
if parsed.get("event_type") == "chat.final":
- tm_ = get_team_manager(channel_id)
- should_finish_round = (
- (not tm_.has_seen_team_events(session_id))
- or tm_.is_workflow_completed(session_id)
- )
# Deliver the final content before announcing that the
# round is complete. Clients may stop consuming the stream
# as soon as processing_status(False) arrives.
_broadcast_event(channel_id, session_id, parsed)
- if should_finish_round:
- _broadcast_event(
- channel_id,
- session_id,
- {
- "event_type": "chat.processing_status",
- "session_id": session_id,
- "rid": round_id,
- "is_processing": False,
- "is_complete": True,
- },
- )
- if is_leader and await _team_round_settled(channel_id, session_id):
- logger.info(
- "[TeamHelpers] leader final with settled team; finish round "
- "and close stream: channel_id=%s session_id=%s",
- _resolve_channel_id(channel_id),
- session_id,
- )
+ if is_leader and await _finish_round_if_settled(
+ channel_id, session_id, round_id, reason="leader chat.final"
+ ):
break
continue
_broadcast_event(channel_id, session_id, parsed)
+ # member-settle edge (leader-only): when a member transitions to
+ # a settled status, re-evaluate settle and close the stream if
+ # the round is settled — without waiting for a second leader
+ # chat.final (the 10:41 incident case: leader final arrived
+ # while members were still busy, so the stream hung).
+ if is_leader:
+ evt = parsed.get("event") or {}
+ new_status = str(evt.get("new_status") or "")
+ if new_status in _TEAM_MEMBER_SETTLED_STATUSES:
+ if await _finish_round_if_settled(
+ channel_id, session_id, round_id,
+ reason=f"member {evt.get('member_id')} -> {new_status}",
+ ):
+ break
# If stream ended without any chunks, broadcast an error event
if received_chunks == 0:
diff --git a/tests/unit_tests/agentserver/test_team_helpers.py b/tests/unit_tests/agentserver/test_team_helpers.py
index 0870492aef..9a57642517 100644
--- a/tests/unit_tests/agentserver/test_team_helpers.py
+++ b/tests/unit_tests/agentserver/test_team_helpers.py
@@ -65,6 +65,7 @@ class _InactiveTeamRuntimeManagerMixin:
def __init__(self) -> None:
self._seen_team_events: dict[str, bool] = {}
self._workflow_completed: dict[str, bool] = {}
+ self._round_complete_emitted: dict[str, bool] = {}
def mark_seen_team_events(self, session_id: str) -> None:
self._seen_team_events[session_id] = True
@@ -75,6 +76,13 @@ class _InactiveTeamRuntimeManagerMixin:
def reset_seen_team_events(self, session_id: str) -> None:
self._seen_team_events.pop(session_id, None)
+ def claim_round_complete(self, session_id: str) -> bool:
+ # Inactive runtime must never authorize a completion broadcast.
+ return False
+
+ def reset_round_complete(self, session_id: str) -> None:
+ self._round_complete_emitted.pop(session_id, None)
+
def mark_workflow_completed(self, session_id: str) -> None:
self._workflow_completed[session_id] = True
@@ -3239,6 +3247,118 @@ async def test_leader_final_keeps_unsettled_round_open(monkeypatch, blocker):
assert closed == ["closed"]
+async def test_member_settle_edge_closes_stream_without_second_leader_final(monkeypatch):
+ """Repro for the 10:41 hang: the leader's chat.final arrives while a member
+ is still busy (first settle check False -> stream stays open), then a member
+ transitions to ready — the member-settle edge re-evaluates settle and closes
+ the stream with exactly one is_complete, without a second leader chat.final.
+ """
+ broadcasted: list[dict] = []
+ closed: list[str] = []
+
+ async def _hanging_stream(**kwargs):
+ try:
+ # Leader final arrives while a member is busy -> first settle check
+ # is False, so the stream must stay open (no is_complete yet).
+ yield {"event_type": "chat.final", "content": "等待回复"}
+ # Member transitions to ready -> the settle edge must fire and close.
+ yield {
+ "event_type": "team.member",
+ "event": {
+ "type": "team.member.status_changed",
+ "member_id": "run1:analyst",
+ "old_status": "busy",
+ "new_status": "ready",
+ },
+ }
+ await asyncio.Event().wait() # hang if the edge does not fire
+ finally:
+ closed.append("closed")
+
+ class _FakeMessageManager:
+ @staticmethod
+ async def has_unread_messages(*, include_broadcast: bool) -> bool:
+ return False
+
+ class _FakeMonitorHandler:
+ _monitor = SimpleNamespace(
+ _team_agent=SimpleNamespace(
+ team_backend=SimpleNamespace(message_manager=_FakeMessageManager())
+ )
+ )
+
+ def __init__(self) -> None:
+ self._calls = 0
+
+ async def get_team_snapshot(self):
+ # First settle check (leader chat.final): a member is busy -> not settled.
+ # Subsequent check (member->ready edge): all members ready -> settled.
+ self._calls += 1
+ if self._calls <= 1:
+ return {"members": [{"member_id": "run1:analyst", "status": "busy"}], "tasks": []}
+ return {"members": [{"member_id": "run1:analyst", "status": "ready"}], "tasks": []}
+
+ shared_monitor = _FakeMonitorHandler()
+
+ class _FakeManager(_InactiveTeamRuntimeManagerMixin):
+ @staticmethod
+ def clear_pending_runtime(session_id: str) -> None:
+ pass
+
+ @staticmethod
+ def clear_active_runtime(session_id: str) -> None:
+ pass
+
+ @staticmethod
+ def get_monitor_handler(session_id: str):
+ return shared_monitor
+
+ @staticmethod
+ def get_workflow_handler(session_id: str):
+ return None
+
+ @staticmethod
+ def claim_round_complete(session_id: str) -> bool:
+ return True
+
+ @staticmethod
+ def pop_stream_task(session_id: str) -> None:
+ pass
+
+ monkeypatch.setattr(team_helpers, "_run_agent_team_streaming", _hanging_stream)
+ monkeypatch.setattr(team_helpers, "get_team_manager", lambda channel_id: _FakeManager())
+ monkeypatch.setattr(team_helpers, "append_history_record", lambda **kwargs: None)
+ monkeypatch.setattr(
+ team_helpers,
+ "_broadcast_event",
+ lambda channel_id, session_id, event: broadcasted.append(event),
+ )
+
+ await asyncio.wait_for(
+ _TeamHelpersTestApi.consume_stream_with_query(
+ "officeclaw",
+ "sess-member-settle",
+ SimpleNamespace(team_name="demo-team"),
+ "你好",
+ ),
+ timeout=0.5,
+ )
+
+ # Exactly one is_complete frame, emitted by the member->ready edge.
+ is_complete = [
+ e for e in broadcasted
+ if e.get("event_type") == "chat.processing_status" and e.get("is_complete")
+ ]
+ assert len(is_complete) == 1
+ # Exactly one leader chat.final (the one that arrived while busy); the
+ # member->ready edge must NOT require a second leader chat.final.
+ finals = [e for e in broadcasted if e.get("event_type") == "chat.final"]
+ assert len(finals) == 1
+ # The stream closed (member-settle edge fired, did not hang).
+ assert closed == ["closed"]
+
+
@pytest.mark.anyio
async def test_consume_stream_with_query_broadcasts_leader_and_teammate_outputs(monkeypatch):
broadcasted: list[dict] = []
@@ -3376,22 +3496,20 @@ async def test_consume_stream_with_query_broadcasts_leader_and_teammate_outputs(
)
assert ready_calls == [("sess-leader-only", "demo-team")]
- # After team.runtime_ready is broadcast, seen_team_events=True so
- # chat.final events are suppressed; team.completed emits
- # chat.processing_status(is_complete=True) instead.
+ # The inactive runtime never settles (_team_round_settled is False: the
+ # manager exposes no monitor_handler) and never authorises completion
+ # (claim_round_complete returns False). Until the team settles, NO
+ # is_complete frame may be emitted — the "before-settle" invariant of
+ # the per-round dedup contract.
assert [event["event_type"] for event in broadcasted] == [
"chat.processing_status",
"team.runtime_ready",
"chat.usage_metadata",
'chat.final',
- 'chat.processing_status',
'chat.reasoning',
'chat.tool_call',
'chat.final',
- 'chat.processing_status',
'chat.final',
- 'chat.processing_status',
- "chat.processing_status",
'team.completed',
]
usage_event = next(
@@ -3419,14 +3537,21 @@ async def test_consume_stream_with_query_broadcasts_leader_and_teammate_outputs(
# Round-start processing_status
assert broadcasted[0]["is_processing"] is True
assert broadcasted[0]["is_complete"] is False
- # Round-end processing_status (from team.completed)
- assert broadcasted[-2]["is_processing"] is False
- assert broadcasted[-2]["is_complete"] is True
- for index, event in enumerate(broadcasted):
- if event.get("event_type") == "chat.final":
- next_event = broadcasted[index + 1]
- assert next_event["event_type"] == "chat.processing_status"
- assert next_event["is_processing"] is False
+ # Explicit "before-settle" invariant: no is_complete frame is emitted
+ # while the round is unsettled — the leader chat.final keeps the round
+ # open (helper returns False) and the team.completed poll path is
+ # blocked by claim_round_complete.
+ is_complete_frames = [
+ event
+ for event in broadcasted
+ if event.get("event_type") == "chat.processing_status"
+ and event.get("is_complete") is True
+ ]
+ assert is_complete_frames == []
+ # The post-loop team.completed marker is still broadcast as the round's
+ # terminal control event (carries no is_complete payload — the dedup
+ # only governs processing_status(is_complete=True) frames).
+ assert broadcasted[-1]["event_type"] == "team.completed"
@pytest.mark.anyio
@@ -4980,3 +5105,145 @@ async def test_consume_stream_does_not_inject_session_id_into_other_events(monke
delta_events = [e for e in broadcasted if e.get("event_type") == "chat.delta"]
assert len(delta_events) == 1
assert "session_id" not in delta_events[0]
+
+
+async def test_round_complete_dedup_claim_then_reset():
+ """claim_round_complete returns True once per round, False after; reset re-arms."""
+ from jiuwenswarm.agents.harness.team.team_manager import TeamManager
+
+ # Lightest path: bypass __init__, set only the dict under test.
+ # If test_team_manager_registry.py has a real fixture, prefer it.
+ tm = TeamManager.__new__(TeamManager)
+ tm._round_complete_emitted = {}
+
+ assert tm.claim_round_complete("s1") is True # first claim
+ assert tm.claim_round_complete("s1") is False # second claim same round → idempotent
+ tm.reset_round_complete("s1")
+ assert tm.claim_round_complete("s1") is True # re-armed after reset
+ tm.reset_round_complete("never-existed") # no-op, no KeyError
+
+
+async def test_finish_round_if_settled_broadcasts_once_when_settled(monkeypatch):
+ class _FakeMessageManager:
+ @staticmethod
+ async def has_unread_messages(*, include_broadcast: bool) -> bool:
+ return False
+ class _FakeMonitorHandler:
+ _monitor = SimpleNamespace(
+ _team_agent=SimpleNamespace(
+ team_backend=SimpleNamespace(message_manager=_FakeMessageManager())
+ )
+ )
+ async def get_team_snapshot(self):
+ return {"members": [{"member_id": "leader", "status": "ready"}], "tasks": []}
+ class _FakeManager:
+ _claimed = {}
+ @staticmethod
+ def get_monitor_handler(session_id):
+ return _FakeMonitorHandler()
+ @staticmethod
+ def get_workflow_handler(session_id):
+ return None
+ @staticmethod
+ def claim_round_complete(session_id):
+ if _FakeManager._claimed.get(session_id):
+ return False
+ _FakeManager._claimed[session_id] = True
+ return True
+ @staticmethod
+ def reset_round_complete(session_id):
+ _FakeManager._claimed.pop(session_id, None)
+
+ monkeypatch.setattr(team_helpers, "get_team_manager", lambda channel_id: _FakeManager())
+ broadcasts: list[dict] = []
+ monkeypatch.setattr(team_helpers, "_broadcast_event", lambda *a, **k: broadcasts.append(k.get("payload") or a[-1]))
+
+ finish = getattr(team_helpers, "_finish_round_if_settled")
+ closed = await finish("officeclaw", "sess", 1, reason="test")
+ assert closed is True
+ is_complete = [p for p in broadcasts if isinstance(p, dict) and p.get("event_type") == "chat.processing_status" and p.get("is_complete")]
+ assert len(is_complete) == 1
+
+
+async def test_finish_round_if_settled_no_broadcast_when_not_settled(monkeypatch):
+ class _FakeMonitorHandler:
+ async def get_team_snapshot(self):
+ return {"members": [{"member_id": "leader", "status": "busy"}], "tasks": []}
+ class _FakeManager:
+ @staticmethod
+ def get_monitor_handler(session_id):
+ return _FakeMonitorHandler()
+ @staticmethod
+ def get_workflow_handler(session_id):
+ return None
+ @staticmethod
+ def claim_round_complete(session_id):
+ raise AssertionError("must not claim when not settled")
+
+ monkeypatch.setattr(team_helpers, "get_team_manager", lambda channel_id: _FakeManager())
+ broadcasts: list[dict] = []
+ monkeypatch.setattr(team_helpers, "_broadcast_event", lambda *a, **k: broadcasts.append(k.get("payload") or a[-1]))
+
+ finish = getattr(team_helpers, "_finish_round_if_settled")
+ closed = await finish("officeclaw", "sess", 1, reason="test")
+ assert closed is False
+ assert broadcasts == []
+
+
+async def test_team_round_settled_empty_board_blocked_when_toggle_false(monkeypatch):
+ class _FakeMessageManager:
+ @staticmethod
+ async def has_unread_messages(*, include_broadcast: bool) -> bool:
+ return False
+ class _FakeMonitorHandler:
+ _monitor = SimpleNamespace(
+ _team_agent=SimpleNamespace(
+ team_backend=SimpleNamespace(message_manager=_FakeMessageManager())
+ )
+ )
+ async def get_team_snapshot(self):
+ return {"members": [{"member_id": "leader", "status": "ready"}], "tasks": []}
+ class _FakeManager:
+ @staticmethod
+ def get_monitor_handler(session_id):
+ return _FakeMonitorHandler()
+ @staticmethod
+ def get_workflow_handler(session_id):
+ return None
+
+ monkeypatch.setattr(team_helpers, "get_team_manager", lambda channel_id: _FakeManager())
+ monkeypatch.setattr(team_helpers, "_taskless_completion_enabled", lambda session_id: False)
+
+ assert not await _TeamHelpersTestApi.team_round_settled("officeclaw", "sess-toggle")
+
+
+async def test_team_round_settled_empty_board_passes_when_toggle_true(monkeypatch):
+ class _FakeMessageManager:
+ @staticmethod
+ async def has_unread_messages(*, include_broadcast: bool) -> bool:
+ return False
+ class _FakeMonitorHandler:
+ _monitor = SimpleNamespace(
+ _team_agent=SimpleNamespace(
+ team_backend=SimpleNamespace(message_manager=_FakeMessageManager())
+ )
+ )
+ async def get_team_snapshot(self):
+ return {"members": [{"member_id": "leader", "status": "ready"}], "tasks": []}
+ class _FakeManager:
+ @staticmethod
+ def get_monitor_handler(session_id):
+ return _FakeMonitorHandler()
+ @staticmethod
+ def get_workflow_handler(session_id):
+ return None
+
+ monkeypatch.setattr(team_helpers, "get_team_manager", lambda channel_id: _FakeManager())
+ monkeypatch.setattr(team_helpers, "_taskless_completion_enabled", lambda session_id: True)
+
+ assert await _TeamHelpersTestApi.team_round_settled("officeclaw", "sess-toggle")