Skip to content

[Bugfix] Treat explicit parallel_tool_calls=null as the documented default - #45355

Closed
HumphreySun98 wants to merge 1 commit into
vllm-project:mainfrom
HumphreySun98:fix/44948-parallel-tool-calls-null
Closed

HumphreySun98 wants to merge 1 commit into
vllm-project:mainfrom
HumphreySun98:fix/44948-parallel-tool-calls-null

Conversation

@HumphreySun98

Copy link
Copy Markdown
Contributor

Purpose

Fixes #44948.

An explicit `parallel_tool_calls: null` was filtered like `false` (trimming the response to a single tool call) because `maybe_filter_parallel_tool_calls` gated on truthiness (`if request.parallel_tool_calls:`). The field is documented as defaulting to `true`, and an omitted field correctly keeps all tool calls — explicit `null` means "unspecified" and must resolve to the same default.

Request value Before After
omitted keeps all (default `true`) keeps all
`true` keeps all keeps all
`false` trims to first trims to first
`null` trims to first keeps all

Fix: gate on `request.parallel_tool_calls is not False`, so only an explicit `false` trims — matching the function's own docstring ("when parallel_tool_calls is False") and the Rust frontend's `unwrap_or(true)` semantics (#44760).

Duplicate-work check

Per `AGENTS.md`: `gh pr list --search "44948"` / `"parallel_tool_calls null"` — no other PR addresses this.

Test Plan

New `tests/entrypoints/openai/test_tool_calls_utils.py` (`@pytest.mark.cpu_test`, no GPU/network) covering omitted / `true` / `false` / `null` on both the full-response and streaming paths — 6 tests, including the two explicit-`null` regression cases.

Test Result

```
$ python -m pytest tests/entrypoints/openai/test_tool_calls_utils.py -v
==== 6 passed in 14.92s ====

$ pre-commit run --files vllm/entrypoints/serve/utils/tool_calls_utils.py tests/entrypoints/openai/test_tool_calls_utils.py
ruff check / ruff format / typos / mypy / SPDX ... all Passed
```

cc @njhill @chaunceyjiang (cc'd on the issue)

AI assistance disclosure

This change was AI-assisted (Claude). I (the submitter) reviewed every line, ran the tests above, and stand behind the change end-to-end.

…fault

An explicit 'parallel_tool_calls: null' was filtered like 'false'
(trimming the response to a single tool call) because the filter gated
on truthiness. The field is documented as defaulting to true, and an
omitted field correctly keeps all tool calls -- explicit null means
'unspecified' and must resolve the same way.

Gate on 'is not False' so only an explicit false trims, matching the
docstring ('when parallel_tool_calls is False') and the Rust frontend's
unwrap_or(true) semantics.

Adds unit tests covering omitted/true/false/null on both the full and
streaming response paths.

Fixes vllm-project#44948.

Signed-off-by: HumphreySun98 <humphreysun98@gmail.com>
@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@HumphreySun98

Copy link
Copy Markdown
Contributor Author

Closing as duplicate — #44955 (2 days earlier) and #45139 (1 day earlier, with tests) already address the same fix. My issue-number-based duplicate search missed them because neither references #44948 in indexed fields; apologies for the noise. Deferring to the earlier PRs.

@HumphreySun98
HumphreySun98 deleted the fix/44948-parallel-tool-calls-null branch June 12, 2026 03:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend tool-calling

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: explicit parallel_tool_calls: null is filtered like false instead of the documented "true" default

1 participant