Skip to content

Commit a80c6e9

Browse files
committed
add final assistant response
1 parent b486ebc commit a80c6e9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

eval_protocol/mcp/execution/manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,15 @@ async def _execute_rollout(
337337
"tool_calls": [f"{tool_call.tool_name}({tool_call.arguments})"],
338338
"num_tool_calls": 1,
339339
}
340+
print(f"🔍 control_plane_step: {control_plane_step}")
340341
conversation_history[-1]["control_plane_step"] = control_plane_step
341342
trajectory.control_plane_steps.append(control_plane_step)
342343

343344
# Log conversation state for playback if in recording mode
344345
if recording_mode:
345346
policy.log_conversation_state_for_playback(rollout_idx, step - 1, conversation_history)
346347

348+
# tool indicates rollout should be terminated, call policy one last time to get the final response
347349
if rollout_end:
348350
trajectory.terminated = True
349351
trajectory.termination_reason = TerminationReason.CONTROL_PLANE_SIGNAL
@@ -390,6 +392,9 @@ async def _execute_rollout(
390392
trajectory.terminated = True
391393
trajectory.termination_reason = TerminationReason.CONTROL_PLANE_SIGNAL
392394

395+
_, usage_stats = await policy(tool_schema, rollout_idx, conversation_history)
396+
usage_stats_list.append(usage_stats)
397+
393398
# Add final control plane summary
394399
trajectory.control_plane_summary.update(
395400
{

0 commit comments

Comments
 (0)