Anton Sokolchenko
05a61510b9
Fix Qwen3 content extraction breaking code formatting (#661)
Problem:
- qwen3::extract_content_during_parsing() used aggressive regex to collapse multiple newlines
- This broke proper code formatting (e.g., PEP 8's 2 empty lines between functions)
- Affected non-tool-call streaming output where formatting is critical
Solution:
- Replace aggressive std::regex_replace(R"(\n\s*\n)", "\n") with gentle string_strip()
- Follow original llama.cpp patterns: only trim leading/trailing whitespace
- Preserve internal formatting including multiple newlines
- Add proper include for common.h to access string_strip function
Changes:
- examples/server/parsers/qwen3_parser.hpp: Replace whitespace cleanup with string_strip()
- tests/test-function-calls.cpp: Add test_qwen3_whitespace_preservation() to prevent regression
Testing:
- ✅ PEP 8 compliance: 2 empty lines between functions preserved
- ✅ Tool call parsing: All Qwen3 tests continue to pass
- ✅ No regressions: Existing functionality maintained
- ✅ Follows original llama.cpp whitespace handling patterns
2025-08-07 08:22:01 +03:00
..
2024-08-12 15:14:32 +02:00
2024-07-27 07:55:01 +02:00
2025-01-12 13:19:14 +02:00
2024-07-27 07:55:01 +02:00
2024-06-13 00:41:52 +01:00
2024-06-13 00:41:52 +01:00
2025-07-02 08:49:42 +02:00
2024-07-27 07:55:01 +02:00
2024-08-12 15:14:32 +02:00
2024-08-12 15:14:32 +02:00
2025-07-02 08:49:42 +02:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2025-05-23 08:07:42 +03:00
2024-06-21 08:38:22 +03:00
2025-05-13 17:53:38 +03:00
2025-06-19 10:24:53 +03:00
2024-06-13 00:41:52 +01:00
2025-04-07 10:43:26 +02:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2025-06-19 10:24:53 +03:00
2025-06-19 10:24:53 +03:00
2025-06-19 10:24:53 +03:00
2025-06-19 10:24:53 +03:00
2024-07-27 07:55:01 +02:00
2025-06-19 10:24:53 +03:00
2024-07-27 07:55:01 +02:00
2025-04-12 16:17:50 +02:00
2025-07-20 10:05:23 +02:00
2025-07-14 18:55:08 +02:00
2024-08-12 15:14:32 +02:00
2025-06-19 10:24:53 +03:00
2024-08-12 15:14:32 +02:00
2025-08-07 08:22:01 +03:00
2024-08-12 15:14:32 +02:00
2025-06-19 10:24:53 +03:00
2025-05-12 07:50:26 +03:00
2024-08-12 15:14:32 +02:00
2024-08-12 15:14:32 +02:00
2024-06-13 00:41:52 +01:00
2023-03-29 20:21:09 +03:00
2024-06-13 00:41:52 +01:00
2024-06-13 00:41:52 +01:00
2024-06-13 00:41:52 +01:00
2024-06-13 00:41:52 +01:00
2025-02-23 00:16:27 -06:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2024-01-23 08:51:27 +02:00
2023-08-30 09:50:55 +03:00
2024-06-13 00:41:52 +01:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2024-06-13 00:41:52 +01:00
2024-07-27 07:55:01 +02:00
2024-07-27 07:55:01 +02:00
2024-06-13 00:41:52 +01:00
2024-04-12 19:43:38 +01:00