diff --git a/evalharness/agent/envs/tau2_official.py b/evalharness/agent/envs/tau2_official.py index 2f4413c..015352d 100644 --- a/evalharness/agent/envs/tau2_official.py +++ b/evalharness/agent/envs/tau2_official.py @@ -119,6 +119,14 @@ def _patch_tau2_generate(adapter, user_adapter=None, gen_kwargs=None) -> None: import json as _json + # strip thinking leakage: hybrid backends inline reasoning in + # content as '...scenario reasoning...visible reply' -- the + # USER simulator's leak hands the agent the scenario's secret + # instructions (task goal, what to disclose), inflating rewards + text = out.text or '' + if '' in text: + text = text.rsplit('', 1)[-1].strip() + calls = [] for c in out.tool_calls: try: @@ -127,7 +135,7 @@ def _patch_tau2_generate(adapter, user_adapter=None, gen_kwargs=None) -> None: args = {'raw': c.arguments} calls.append(TauToolCall(id=c.id or f'call_{c.name}', name=c.name, arguments=args or {})) - return AssistantMessage(role='assistant', content=out.text or '', + return AssistantMessage(role='assistant', content=text, tool_calls=calls or None, cost=None, usage=None, raw_data=None)