common/parser: fix reasoning whitespace bugs + extra parser tests (#21085)

* fix whitespace reasoning issues + add reconstruction tests

* Proper fix

* fix Nemotron autoparser test expectations to include newline in marker
This commit is contained in:
Piotr Wilkin (ilintar) 2026-03-28 07:29:26 +01:00 committed by GitHub
parent c46758d28f
commit 1f5d15e665
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 141 additions and 35 deletions

View file

@ -1330,7 +1330,7 @@ static void test_nemotron_reasoning_detection(testing & t) {
analysis.analyze_template(tmpl);
// Check reasoning markers
t.assert_equal("reasoning_start should be '<think>'", "<think>", analysis.reasoning.start);
t.assert_equal("reasoning_start should be '<think>\\n'", "<think>\n", analysis.reasoning.start);
t.assert_equal("reasoning_end should be '</think>'", "</think>", analysis.reasoning.end);
// Check reasoning mode detection