vllm - 💡(How to fix) Fix [Bug]: explicit `parallel_tool_calls: null` is filtered like false instead of the documented "true" default [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Introduced in #26233 (which also set the True default). Surfaced while porting the field to the Rust frontend in #44760, where unwrap_or(true) treats null as the default. This issue tracks the alignment on the Python side.

Root Cause

The field defaults to True: https://github.com/vllm-project/vllm/blob/4128605ad4197551a5ae4de08ede38f2348d1eb5/vllm/entrypoints/openai/chat_completion/protocol.py#L233

…but the filter gates on truthiness, so an explicit null (None) is falsy and filtered the same as false: https://github.com/vllm-project/vllm/blob/4128605ad4197551a5ae4de08ede38f2348d1eb5/vllm/entrypoints/serve/utils/tool_calls_utils.py#L19-L37

Two mismatches:

  1. The docstring says filter "when parallel_tool_calls is False", but if request.parallel_tool_calls: also fires on None.
  2. Since true is the default, an unspecified value (null) should resolve to the default, not to false.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

An explicit parallel_tool_calls: null is treated like false, trimming the response to a single tool call. The docs define only true and false; explicit null is unspecified:

Setting it to true (the default) allows returning more than one tool call per request.

Since true is the documented default and null conveys "unspecified," the natural reading is that an explicit null should resolve to that default, just like an omitted field. If so, this is a bug: an omitted field correctly defaults to true, but explicit null falls through as falsy and is filtered like false.

Context

Introduced in #26233 (which also set the True default). Surfaced while porting the field to the Rust frontend in #44760, where unwrap_or(true) treats null as the default. This issue tracks the alignment on the Python side.

Current Behavior

Request valueResolves toResult
omittedTrue (default)keeps all tool calls
trueTruekeeps all tool calls
falseFalsetrims to first
nullNonetrims to first ← unexpected

Root Cause

The field defaults to True: https://github.com/vllm-project/vllm/blob/4128605ad4197551a5ae4de08ede38f2348d1eb5/vllm/entrypoints/openai/chat_completion/protocol.py#L233

…but the filter gates on truthiness, so an explicit null (None) is falsy and filtered the same as false: https://github.com/vllm-project/vllm/blob/4128605ad4197551a5ae4de08ede38f2348d1eb5/vllm/entrypoints/serve/utils/tool_calls_utils.py#L19-L37

Two mismatches:

  1. The docstring says filter "when parallel_tool_calls is False", but if request.parallel_tool_calls: also fires on None.
  2. Since true is the default, an unspecified value (null) should resolve to the default, not to false.

Expected

parallel_tool_calls: null should behave like an omitted field (default true, keep all tool calls). Minimal fix: gate on request.parallel_tool_calls is False rather than truthiness, matching the docstring.

cc @njhill @chaunceyjiang

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING