Skip to content

Commit 1d630d4

Browse files
committed
address comments
1 parent a8c103d commit 1d630d4

2 files changed

Lines changed: 5 additions & 23 deletions

File tree

eval_protocol/mcp/execution/base_policy.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,6 @@ def __init__(
5959
# Initialize conversation state tracking for proper OpenAI trajectories
6060
self.initialized = False
6161

62-
def _supports_reasoning_details(self) -> bool:
63-
"""
64-
Returns True if this policy is configured for a provider/model that expects
65-
top-level reasoning_details to be preserved (e.g., Gemini 3 via OpenRouter).
66-
"""
67-
model_id = getattr(self, "model_id", "") or ""
68-
base_url = getattr(self, "base_url", "") or ""
69-
70-
if isinstance(model_id, str) and "openrouter" in model_id:
71-
return True
72-
if isinstance(base_url, str) and "openrouter.ai" in base_url:
73-
return True
74-
return False
75-
7662
@abstractmethod
7763
async def _make_llm_call(self, messages: List[Dict], tools: List[Dict]) -> Dict:
7864
"""
@@ -214,7 +200,7 @@ async def _generate_live_tool_calls(
214200
assistant_message_for_history["tool_calls"] = message["tool_calls"]
215201

216202
rd = message.get("reasoning_details", None)
217-
if rd is not None and self._supports_reasoning_details():
203+
if rd is not None:
218204
assistant_message_for_history["reasoning_details"] = rd
219205

220206
# Add to actual conversation history

eval_protocol/mcp/execution/policy.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,7 @@ def _clean_messages_for_api(self, messages: List[Dict]) -> List[Dict]:
146146
Clean messages with only OpenAI API compatible fields
147147
"""
148148
# Standard OpenAI message fields
149-
allowed_fields = {"role", "content", "tool_calls", "tool_call_id", "name"}
150-
151-
if self._supports_reasoning_details():
152-
allowed_fields.add("reasoning_details")
149+
allowed_fields = {"role", "content", "tool_calls", "tool_call_id", "name", "reasoning_details"}
153150

154151
clean_messages = []
155152
for msg in messages:
@@ -242,10 +239,9 @@ async def _make_llm_call(self, messages: List[Dict[str, Any]], tools: List[Dict[
242239
),
243240
}
244241

245-
if self._supports_reasoning_details():
246-
rd = getattr(message_obj, "reasoning_details", None)
247-
if rd is not None:
248-
message_dict["reasoning_details"] = rd
242+
rd = getattr(message_obj, "reasoning_details", None)
243+
if rd is not None:
244+
message_dict["reasoning_details"] = rd
249245

250246
return {
251247
"choices": [

0 commit comments

Comments
 (0)