From 913b688f21fa2cb380713c879216d53f3eb4f651 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Wed, 7 Jan 2026 12:00:09 +0800 Subject: [PATCH] fix: fill a meaningful tool_index (#16504) --- python/sglang/srt/function_call/base_format_detector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/sglang/srt/function_call/base_format_detector.py b/python/sglang/srt/function_call/base_format_detector.py index 2b83893f5..03a0c6e43 100644 --- a/python/sglang/srt/function_call/base_format_detector.py +++ b/python/sglang/srt/function_call/base_format_detector.py @@ -83,7 +83,7 @@ class BaseFormatDetector(ABC): results.append( ToolCallItem( - tool_index=-1, # Caller should update this based on the actual tools array called + tool_index=tool_indices.get(name, -1), name=name, parameters=json.dumps( act.get("parameters") or act.get("arguments", {}),