diff --git a/evalharness/eval/recipes/agent.py b/evalharness/eval/recipes/agent.py index 73e1d7d..6a90ba3 100644 --- a/evalharness/eval/recipes/agent.py +++ b/evalharness/eval/recipes/agent.py @@ -262,16 +262,23 @@ def swe_bench_verified(): def _tau2_reward(pred, target, sample, ctx): - """Score from the official engine's reward_info (env_state).""" + """Score from the official engine's reward_info (env_state). + + Current tau2 reward_info carries the COMPOSITE 'reward' plus detail + fields (db_check / action_checks / communicate_checks); the old + environment_reward/communication_reward split no longer exists.""" env_state = ctx.params.get('env_state') or {} rewards = env_state.get('tau2_rewards') or {} - env_r = rewards.get('environment_reward') - comm_r = rewards.get('communication_reward') - vals = [r for r in (env_r, comm_r) if isinstance(r, (int, float))] - score = float(sum(vals) / len(vals)) if vals else 0.0 - return ({'acc': score}, {'acc': {'mode': 'official_tau2', - 'env_reward': env_r, - 'comm_reward': comm_r}}) + r = rewards.get('reward') + if not isinstance(r, (int, float)): + vals = [v for v in (rewards.get('environment_reward'), + rewards.get('communication_reward')) + if isinstance(v, (int, float))] + r = sum(vals) / len(vals) if vals else 0.0 + return ({'acc': float(r)}, {'acc': {'mode': 'official_tau2', + 'reward': r, + 'db_check': rewards.get('db_check'), + 'note': str((rewards.get('info') or {}).get('note', ''))[:120]}}) @register_eval('tau2_bench')