From b09e23d8c40d5b0760cee9994778996add346bab Mon Sep 17 00:00:00 2001 From: David <12414531+DavidBellamy@users.noreply.github.com> Date: Wed, 1 Jul 2026 03:18:02 +0000 Subject: [PATCH] Pass sample_idx through to the custom agent function agentic_tool_call.generate forwards only `metadata` to the custom agent function, so a sample's `index` never reaches it. Harbor's dashboard hooks now require `request.sample_idx` (LLM360/RL360 #432 replaced Harbor's internal trial counter with `request.sample_idx`), so every agentic trial fails with "sample_idx is required". Lift `sample.index` into the metadata passed to the agent, matching the existing `metadata = {**metadata, ...}` augmentations (max_seq_len, session_server_id). --- miles/rollout/generate_hub/agentic_tool_call.py | 1 + 1 file changed, 1 insertion(+) diff --git a/miles/rollout/generate_hub/agentic_tool_call.py b/miles/rollout/generate_hub/agentic_tool_call.py index feba568164..89e0bf7fc4 100644 --- a/miles/rollout/generate_hub/agentic_tool_call.py +++ b/miles/rollout/generate_hub/agentic_tool_call.py @@ -59,6 +59,7 @@ async def generate(input: GenerateFnInput) -> GenerateFnOutput: max_seq_len = getattr(input.args, "max_seq_len", None) metadata = input.sample.metadata + metadata = {**metadata, "sample_idx": input.sample.index} if max_seq_len is not None: metadata = {**metadata, "max_seq_len": max_seq_len} if tracer.session_server_instance_id: