From e015b5035f5e333531b803b50ccdf73dd5cf5204 Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Thu, 17 Sep 2026 09:12:17 +0000 Subject: [PATCH] max_turns: config-driven (default 200), runner default 8 -> 200 YAML default section and per-bench (tau2_bench: 200) both set it; the runner's generic 8-starved every agent dialog (tau2 reward-0 root cause). CLI wiring pops the key into args.max_turns before the generation keys are stripped. Co-Authored-By: Claude --- evalharness/cli.py | 6 +++++- evalharness/config/default.yaml | 2 ++ evalharness/model/runner.py | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/evalharness/cli.py b/evalharness/cli.py index 5c995d3..3a4593a 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -792,8 +792,12 @@ def _cmd_eval_run(args) -> int: _env_cfg = bench_cfg.pop('env', '') or '' if _env_cfg: args.env = _env_cfg + # max_turns: per-bench from YAML (agent dialog step budget) + _mt_cfg = bench_cfg.pop('max_turns', None) + if _mt_cfg: + args.max_turns = int(_mt_cfg) # strip non-generation keys (they go to run_eval kwargs) - for k in ('judge', 'judge_url', 'max_turns', + for k in ('judge', 'judge_url', 'limit', 'limit_per_task', 'concurrency'): bench_cfg.pop(k, None) diff --git a/evalharness/config/default.yaml b/evalharness/config/default.yaml index 3ce0253..47da330 100644 --- a/evalharness/config/default.yaml +++ b/evalharness/config/default.yaml @@ -3,6 +3,7 @@ default: top_p: 1.0 stream: true max_tokens: 32768 + max_turns: 200 aime24: temperature: 1.0 repeats: 12 @@ -60,3 +61,4 @@ general_fc: tau2_bench: max_tokens: 16384 env: tau2_official # agent 模式:官方引擎 + max_turns: 200 # 一次完整电话流程(问候→验证→找单→政策→执行→确认) diff --git a/evalharness/model/runner.py b/evalharness/model/runner.py index 6e90e12..3c8d6cf 100644 --- a/evalharness/model/runner.py +++ b/evalharness/model/runner.py @@ -38,7 +38,7 @@ async def generate_predictions( env_user_spec: str = '', no_shuffle: bool = False, system: str = '', - max_turns: int = 8, + max_turns: int = 200, max_input_chars: int = 0, max_input_tokens: int = 0, tokenizer_path: str = '', @@ -657,7 +657,7 @@ async def run_eval( env_user_spec: str = '', no_shuffle: bool = False, # fixed-order selection: raw first-N (same-questions parity) system: str = '', - max_turns: int = 8, + max_turns: int = 200, max_input_chars: int = 0, max_input_tokens: int = 0, limit_per_task: Optional[int] = None,