From 7fea7250a46c88c1ba9684d7774d2c4ac17c4b90 Mon Sep 17 00:00:00 2001 From: stingoChen <40136864+stingoChen@users.noreply.github.com> Date: Thu, 26 Feb 2026 22:11:07 +0800 Subject: [PATCH] [Bug] Fix missing tag after tool call in MiniMax 2.1 (#35352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 冬马 Co-authored-by: 冬马 --- vllm/reasoning/minimax_m2_reasoning_parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vllm/reasoning/minimax_m2_reasoning_parser.py b/vllm/reasoning/minimax_m2_reasoning_parser.py index d0333a76b..e4deaed41 100644 --- a/vllm/reasoning/minimax_m2_reasoning_parser.py +++ b/vllm/reasoning/minimax_m2_reasoning_parser.py @@ -87,10 +87,15 @@ class MiniMaxM2AppendThinkReasoningParser(ReasoningParser): def __init__(self, tokenizer: TokenizerLike, *args, **kwargs): super().__init__(tokenizer, *args, **kwargs) self.end_token_id = self.vocab.get("") + self.start_token_id = self.vocab.get("") def is_reasoning_end(self, input_ids: Sequence[int]) -> bool: end_token_id = self.end_token_id - return any(input_id == end_token_id for input_id in reversed(input_ids)) + start_token_id = self.start_token_id + for input_id in reversed(input_ids): + if input_id in (end_token_id, start_token_id): + return input_id == end_token_id + return False def extract_content_ids(self, input_ids: list[int]) -> list[int]: return input_ids