Skip to content

fix(responses_converter): omit tool_choice when request has no tools#1925

Open
bg51717 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
bg51717:fix-tool-choice
Open

fix(responses_converter): omit tool_choice when request has no tools#1925
bg51717 wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
bg51717:fix-tool-choice

Conversation

@bg51717

@bg51717 bg51717 commented Jul 3, 2026

Copy link
Copy Markdown

The responses->chat converter drops an absent/empty tools list but kept tool_choice, producing requests with tool_choice set and no tools — which vLLM rejects: "When using tool_choice, tools must be set." Drop tool_choice and parallel_tool_calls when there are no real tools, so no-tool requests (LLM judges / plain generation) are emitted conformantly.

Reworked from the original app.py-based patch: the converter now lives in nemo_gym/responses_converter.py, so the fix moved there (rebased on current main). Adds unit tests for the absent-tools / empty-tools / with-tools paths.

@copy-pr-bot

copy-pr-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

The responses->chat converter drops an absent/empty tools list but kept
tool_choice, so no-tool requests (LLM judges / plain generation) carried a
dangling tool_choice="auto" -- which vLLM rejects: "When using `tool_choice`,
`tools` must be set." Pop tool_choice and parallel_tool_calls when there are
no real tools so the emitted chat params are conformant.

Adds unit tests for the absent-tools / empty-tools / with-tools paths.

Signed-off-by: bg51717 <biguo@nvidia.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bg51717 bg51717 force-pushed the fix-tool-choice branch from cdd6c9b to 1c92637 Compare July 3, 2026 07:04
@bg51717 bg51717 changed the title fix(vllm_model): omit tool_choice when request has no tools fix(responses_converter): omit tool_choice when request has no tools Jul 3, 2026
@bg51717 bg51717 marked this pull request as ready for review July 3, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant