@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 39037d258e
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 9, 10:00 UTC

Fix tool call indexing double-counting (#33141)

Signed-off-by: wanglinian <wanglinian@stu.pku.edu.cn>

wangln19 committed Jan 29, 2026 at 13:57 UTC 39037d258e68da3926d99681ea63e46212e519f9
1 file changed +4 -3
vllm/entrypoints/openai/chat_completion/serving.py
+4 -3
@@ -982,6 +982,7 @@ class OpenAIServingChat(OpenAIServing):
982 index=i,
983 )
984 function_name_returned[i] = True
985 + history_tool_call_cnt += 1
986
987 delta_message = DeltaMessage(
988 tool_calls=[
@@ -1582,7 +1583,7 @@ class OpenAIServingChat(OpenAIServing):
1583 generated_id = make_tool_call_id(
1584 id_type=self.tool_call_id_type,
1585 func_name=tc.name,
1585 - idx=history_tool_call_cnt + idx,
1586 + idx=history_tool_call_cnt,
1587 )
1588 tool_call_class_items.append(
1589 tool_call_class(id=generated_id, function=tc)
@@ -1617,7 +1618,7 @@ class OpenAIServingChat(OpenAIServing):
1618 generated_id = make_tool_call_id(
1619 id_type=self.tool_call_id_type,
1620 func_name=tool_call.name,
1620 - idx=history_tool_call_cnt + idx,
1621 + idx=history_tool_call_cnt,
1622 )
1623 tool_call_class_items.append(
1624 tool_call_class(id=generated_id, function=tool_call)
@@ -1665,7 +1666,7 @@ class OpenAIServingChat(OpenAIServing):
1666 generated_id = make_tool_call_id(
1667 id_type=self.tool_call_id_type,
1668 func_name=tc.name,
1668 - idx=history_tool_call_cnt + idx,
1669 + idx=history_tool_call_cnt,
1670 )
1671 tool_call_items.append(
1672 tool_call_class(id=generated_id, function=tc)