From dc55f493bec8feff986e5f8ddeeabc9ecc1affa6 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Fri, 6 Mar 2026 04:41:47 -0800 Subject: [PATCH] fix: add missing re.DOTALL to DeepSeek V3.1 parser (same bug as V3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The V3.1 parser had the same issue — .*? without re.DOTALL fails to match multi-line JSON arguments. Found during review of PR #444. --- environments/tool_call_parsers/deepseek_v3_1_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/environments/tool_call_parsers/deepseek_v3_1_parser.py b/environments/tool_call_parsers/deepseek_v3_1_parser.py index f0124c38..8456990c 100644 --- a/environments/tool_call_parsers/deepseek_v3_1_parser.py +++ b/environments/tool_call_parsers/deepseek_v3_1_parser.py @@ -35,7 +35,8 @@ class DeepSeekV31ToolCallParser(ToolCallParser): # Regex captures: function_name, function_arguments PATTERN = re.compile( - r"<|tool▁call▁begin|>(?P.*?)<|tool▁sep|>(?P.*?)<|tool▁call▁end|>" + r"<|tool▁call▁begin|>(?P.*?)<|tool▁sep|>(?P.*?)<|tool▁call▁end|>", + re.DOTALL, ) def parse(self, text: str) -> ParseResult: