From 7f431f4520bbd09630b6b2b08fc8c9db54476141 Mon Sep 17 00:00:00 2001 From: seunggil1 Date: Wed, 17 Dec 2025 22:45:32 +0900 Subject: [PATCH 1/3] [Fix] pass chat_template_kwargs to get_system_message in gpt-oss Signed-off-by: seunggil1 --- vllm/entrypoints/openai/serving_chat.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm/entrypoints/openai/serving_chat.py b/vllm/entrypoints/openai/serving_chat.py index 98fc7810faf9..57177f3817e3 100644 --- a/vllm/entrypoints/openai/serving_chat.py +++ b/vllm/entrypoints/openai/serving_chat.py @@ -6,7 +6,7 @@ import time from collections.abc import AsyncGenerator, AsyncIterator from collections.abc import Sequence as GenericSequence -from typing import Final +from typing import Any, Final import jinja2 import partial_json_parser @@ -1796,11 +1796,13 @@ def _make_request_with_harmony( # if the model supports it. TODO: Support browsing. assert not self.supports_browsing assert not self.supports_code_interpreter + _chat_template_kwargs: dict[str, Any] = request.chat_template_kwargs or {} sys_msg = get_system_message( reasoning_effort=request.reasoning_effort, browser_description=None, python_description=None, with_custom_tools=request.tools is not None, + **_chat_template_kwargs, ) messages.append(sys_msg) From a03caeb95c6b784215cfe94ea7702985089ab707 Mon Sep 17 00:00:00 2001 From: seung <38664481+seunggil1@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:39:57 +0900 Subject: [PATCH 2/3] fix : TypeError when passing chat_template_kwargs to get_system_message Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: seung <38664481+seunggil1@users.noreply.github.com> --- vllm/entrypoints/openai/serving_chat.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/vllm/entrypoints/openai/serving_chat.py b/vllm/entrypoints/openai/serving_chat.py index 57177f3817e3..6f0ed941d77b 100644 --- a/vllm/entrypoints/openai/serving_chat.py +++ b/vllm/entrypoints/openai/serving_chat.py @@ -1796,14 +1796,18 @@ def _make_request_with_harmony( # if the model supports it. TODO: Support browsing. assert not self.supports_browsing assert not self.supports_code_interpreter - _chat_template_kwargs: dict[str, Any] = request.chat_template_kwargs or {} - sys_msg = get_system_message( - reasoning_effort=request.reasoning_effort, - browser_description=None, - python_description=None, - with_custom_tools=request.tools is not None, - **_chat_template_kwargs, - ) + sys_msg_kwargs = { + "reasoning_effort": request.reasoning_effort, + "browser_description": None, + "python_description": None, + "with_custom_tools": request.tools is not None, + **(request.chat_template_kwargs or {}), + } + allowed_keys = { + "model_identity", "reasoning_effort", "start_date", "browser_description", + "python_description", "container_description", "instructions", "with_custom_tools" + } + sys_msg = get_system_message(**{k: v for k, v in sys_msg_kwargs.items() if k in allowed_keys}) messages.append(sys_msg) # Add developer message. From bdcd953329162bb80c6c0b9a16effec3aeb4eae5 Mon Sep 17 00:00:00 2001 From: seunggil1 Date: Wed, 17 Dec 2025 23:58:23 +0900 Subject: [PATCH 3/3] [refactor] apply pre-commit Signed-off-by: seunggil1 --- vllm/entrypoints/openai/serving_chat.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/vllm/entrypoints/openai/serving_chat.py b/vllm/entrypoints/openai/serving_chat.py index 6f0ed941d77b..4d7b13d95b72 100644 --- a/vllm/entrypoints/openai/serving_chat.py +++ b/vllm/entrypoints/openai/serving_chat.py @@ -6,7 +6,7 @@ import time from collections.abc import AsyncGenerator, AsyncIterator from collections.abc import Sequence as GenericSequence -from typing import Any, Final +from typing import Final import jinja2 import partial_json_parser @@ -1804,10 +1804,18 @@ def _make_request_with_harmony( **(request.chat_template_kwargs or {}), } allowed_keys = { - "model_identity", "reasoning_effort", "start_date", "browser_description", - "python_description", "container_description", "instructions", "with_custom_tools" + "model_identity", + "reasoning_effort", + "start_date", + "browser_description", + "python_description", + "container_description", + "instructions", + "with_custom_tools", } - sys_msg = get_system_message(**{k: v for k, v in sys_msg_kwargs.items() if k in allowed_keys}) + sys_msg = get_system_message( + **{k: v for k, v in sys_msg_kwargs.items() if k in allowed_keys} + ) messages.append(sys_msg) # Add developer message.