From 15b15748570b1e8211afce2c43ebeacd90089cff Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 17 Sep 2026 09:21:16 +0000 Subject: [PATCH] tau2: module-level silencing (order-independent) Function-level silencers kept losing the race to whichever 'import tau2.*' fired first in the process. The filter + TAU2_DATA_DIR now install when the env registry loads the plugin, strictly before any tau2 import can happen anywhere. Co-Authored-By: Claude --- evalharness/agent/envs/tau2_official.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/evalharness/agent/envs/tau2_official.py b/evalharness/agent/envs/tau2_official.py index bcdedd6..d0672f6 100644 --- a/evalharness/agent/envs/tau2_official.py +++ b/evalharness/agent/envs/tau2_official.py @@ -18,6 +18,25 @@ from typing import Any, Dict, List, Optional from ...data.sample import ChatMessage, Sample from ..loop import Environment, register_env +# ---- module-level, order-independent tau2 silencing -------------------- +# Every function-level silencer proved fragile to import order (banners +# fire at 'import tau2.*' wherever it first happens in the process). +# This block runs when the ENV_REGISTRY loads this plugin -- strictly +# before any tau2 import anywhere -- and is therefore the one that counts. +import os as _os +import sys as _sys + +_os.environ.setdefault('TAU2_DATA_DIR', + '/data1/sora/evalscope/tools/tau2-bench/data') +try: + from loguru import logger as _lg + + _lg.remove() + _lg.add(_sys.stderr, level='ERROR') +except Exception: + pass +# ------------------------------------------------------------------------ + _PATCHED = False