fix(parsers): tools are leaking in the reasoning content (deepseek) - #144
Conversation
Signed-off-by: slivanovich <skuralenok@172.24.29.171-spb.dhcp.yndx.net>
|
Hi @slivanovich, thanks for raising this! Two quick questions:
|
Thanks for the quick response!
|
|
/ok to test 6c720ca |
|
📊 Conformance matrix rendered — view in CI summary |
Signed-off-by: slivanovich <skuralenok@172.24.29.171-spb.dhcp.yndx.net>
|
Have resolved @dynamo-review-agent[bot] comments |
Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
Signed-off-by: Ryan McCormick <mccormick.codes@gmail.com>
There was a problem hiding this comment.
CHanges look good to me, just one small request for the additional prompt-injected batch scenario test described above.
Thanks for finding and fixing this!
We also recently merged foundational Kimi K3 changes that touch the shared parser logic.
Could you merge the latest main into this branch and run the parser tests again to verify everything works together?
Signed-off-by: slivanovich <skuralenok@10.215.217.43-vpn.dhcp.yndx.net>
Hi, thanks for the response! yeah, base parser fix has merged faster) |
|
/ok to test d3f8d64 |
Overview:
Improves DeepSeek V4 reasoning parsing when a model starts emitting DSML tool-call markup before closing an open
<think>block. The parser now treats the DeepSeek DSML tool section marker as a reasoning exit point, preventing tool-call markup from being counted or streamed as reasoning content.Details:
Rust - parsers/v1/src/reasoning/mod.rs
DEEPSEEK_TOOL_SECTION_BEGINfor the DeepSeek DSML tool-call marker<|DSML|starts</think><text that should remain reasoning contentRust - parsers/v1/src/reasoning/base_parser.rs
Rust - parsers/v1/src/tool_calling/dsml/parser.rs
Noneuntil the closing DSML block marker arriveschunk.len()as a completed boundaryRust - parsers/v1/src/tool_calling/parsers.rs
Option<usize>end-position result through the generic tool parser dispatchWhere should the reviewer start?
parsers/v1/src/reasoning/mod.rs:23- DeepSeek DSML marker constant.parsers/v1/src/reasoning/mod.rs:238-242- DeepSeek V4 reasoning parser registration with the DSML tool-start marker.parsers/v1/src/reasoning/base_parser.rs:231-240andparsers/v1/src/reasoning/base_parser.rs:368-378- Partial tool-start buffering in batch and streaming reasoning paths.parsers/v1/src/tool_calling/dsml/parser.rs:51-63- DSML end-position detection returningNonefor incomplete blocks.parsers/v1/src/reasoning/mod.rs:378-438- DeepSeek V4 regression tests covering DSML reasoning exits and split-marker streaming.Related PRs: