@@ -234,10 +234,21 @@ def _format_tool_message_content(
234234class AgentRolloutProcessor (RolloutProcessor ):
235235 """Agent rollout processor for tool-calling agents."""
236236
237+ def __init__ (self , mcp_config_path : Optional [str ] = None ):
238+ """Initialize the agent rollout processor.
239+
240+ Args:
241+ mcp_config_path: Path to MCP configuration file. If provided, this takes
242+ precedence over config.mcp_config_path in __call__.
243+ """
244+ self .mcp_config_path = mcp_config_path
245+
237246 def __call__ (self , rows : List [EvaluationRow ], config : RolloutProcessorConfig ) -> List [asyncio .Task [EvaluationRow ]]:
238247 """Create agent rollout tasks and return them for external handling."""
239248
240249 semaphore = config .semaphore
250+ # Use instance mcp_config_path if provided, otherwise fall back to config
251+ mcp_config_path = self .mcp_config_path if self .mcp_config_path is not None else config .mcp_config_path
241252
242253 async def process_row (row : EvaluationRow ) -> EvaluationRow :
243254 """Process a single row with agent rollout."""
@@ -246,7 +257,7 @@ async def process_row(row: EvaluationRow) -> EvaluationRow:
246257 agent = Agent (
247258 model = row .input_metadata .completion_params ["model" ],
248259 row = row ,
249- config_path = config . mcp_config_path ,
260+ config_path = mcp_config_path ,
250261 logger = config .logger ,
251262 )
252263 try :
0 commit comments