fix: add missing re.DOTALL flag to DeepSeek V3 tool call parser#444
Merged
teknium1 merged 1 commit intoNousResearch:mainfrom Mar 6, 2026
Merged
Conversation
1 task
teknium1
added a commit
that referenced
this pull request
Mar 6, 2026
The V3.1 parser had the same issue — .*? without re.DOTALL fails to match multi-line JSON arguments. Found during review of PR #444.
Contributor
|
Merged in commit 936fda3 🎉 Thanks @PercyDikec! Also found the same bug in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The DeepSeek V3 tool call parser regex was missing
re.DOTALL, so.*couldn't match newlines in thefunction_argumentscapture group. Since tool call JSON arguments are almost always multi-line, the parser silently failed on most real tool calls and returned raw text instead.Every other parser in the codebase (hermes, mistral, glm45, glm47, qwen3_coder, kimi_k2, longcat) already uses
re.DOTALLfor their patterns.Related Issue
Fixes #443
Type of Change
Changes Made
environments/tool_call_parsers/deepseek_v3_parser.py: Addedre.DOTALLflag toPATTERNregex compilationHow to Test
environments/tool_call_parsers/- all usere.DOTALL{"query": "hello"}{ "query": "hello", "limit": 5 }Checklist
Code
Documentation & Housekeeping