From fa60065099cc10b34cd43f93d9a0bac5455d9e3f Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 17 Sep 2026 09:07:53 +0000 Subject: [PATCH] tau2: silence per-message DEBUG floods; is_final_chunk only when done loguru restricted to WARNING+ (every orchestrator step dumped full messages -- thousands of lines per bench). AssistantMessage.is_final_ chunk now False on tool-call turns (official adapter semantics: True means the agent is FINISHED talking); always-True handed the turn back to the user prematurely mid-action-sequence. Co-Authored-By: Claude --- evalharness/agent/envs/tau2_official.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/evalharness/agent/envs/tau2_official.py b/evalharness/agent/envs/tau2_official.py index 015352d..3151203 100644 --- a/evalharness/agent/envs/tau2_official.py +++ b/evalharness/agent/envs/tau2_official.py @@ -12,6 +12,7 @@ The env consumes a Sample whose metadata carries the official Task json import asyncio import json import os +import sys from typing import Any, Dict, List, Optional from ...data.sample import ChatMessage, Sample @@ -29,6 +30,18 @@ _TAU2_LOCAL_CANDIDATES = [ ] +def _silence_tau2_logs(): + """tau2's loguru DEBUG dumps every full message to the terminal -- + thousands of lines per run. Keep WARNING+ only.""" + try: + from loguru import logger + + logger.remove() + logger.add(sys.stderr, level='WARNING') + except Exception: + pass + + def _ensure_tau2_engine(): """Auto-install the REAL tau2-bench engine when missing. @@ -78,6 +91,7 @@ def _patch_tau2_generate(adapter, user_adapter=None, gen_kwargs=None) -> None: return _ensure_tau2_engine() + _silence_tau2_logs() import tau2.utils.llm_utils as llm_utils original = llm_utils.generate @@ -136,7 +150,8 @@ def _patch_tau2_generate(adapter, user_adapter=None, gen_kwargs=None) -> None: calls.append(TauToolCall(id=c.id or f'call_{c.name}', name=c.name, arguments=args or {})) return AssistantMessage(role='assistant', content=text, - tool_calls=calls or None, cost=None, + tool_calls=calls or None, + is_final_chunk=not calls, cost=None, usage=None, raw_data=None) # patch module attr AND every already-imported reference (official