From 676359b7301a160798bca382bc10d44adc06bfa4 Mon Sep 17 00:00:00 2001 From: Juno13340 <35788036+Juno13340@users.noreply.github.com> Date: Thu, 27 Aug 2026 14:18:25 -0400 Subject: [PATCH] [Responses] Return 400 for unsupported forced tool_choice on Harmony A forced named-function tool_choice on gpt-oss/Harmony currently raises NotImplementedError, which maps to HTTP 501. On the OCI data-plane the stateless path retries that 501 four times and surfaces it as a 500, tripping the Responses 5xx alarm; the stateful (SMG) path passes the 501 through. This is client-driven input, not a server fault, so return a 400 by raising VLLMValidationError instead (mapped to BadRequestError by create_error_response). Behavior for auto/none/required is unchanged. Signed-off-by: Juno13340 <35788036+Juno13340@users.noreply.github.com> --- vllm/entrypoints/openai/responses/serving.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vllm/entrypoints/openai/responses/serving.py b/vllm/entrypoints/openai/responses/serving.py index 09c902008a48..960c69b376fb 100644 --- a/vllm/entrypoints/openai/responses/serving.py +++ b/vllm/entrypoints/openai/responses/serving.py @@ -792,9 +792,10 @@ def _make_request_with_harmony( ): has_unsupported_tool_choice = request.tool_choice not in ("auto", "none") if has_unsupported_tool_choice and not is_required_function_call: - raise NotImplementedError( + raise VLLMValidationError( "Only 'auto', 'none', or 'required' (with function tools) " - "tool_choice is supported in response API with Harmony" + "tool_choice is supported in response API with Harmony", + parameter="tool_choice", ) arrival_time = time.time()