fix: preserve whitespace-only chunks in SSE stream (#139)
* fix: preserve whitespace-only chunks in SSE stream Fixes issue #138 where Claude models would swallow spaces between words because whitespace-only chunks (e.g., " ") were being filtered out as empty. Changes: - Modified sse-streamer.js to only skip truly empty strings (""), preserving strings that contain only whitespace. - Added regression test case in tests/test-streaming-whitespace.cjs to verify whitespace preservation. * test: add streaming whitespace regression test to main suite --------- Co-authored-by: walczak <walczak@ial.ruhr>
This commit is contained in:
@@ -18,7 +18,8 @@ const tests = [
|
||||
{ name: 'Cross-Model Thinking', file: 'test-cross-model-thinking.cjs' },
|
||||
{ name: 'OAuth No-Browser Mode', file: 'test-oauth-no-browser.cjs' },
|
||||
{ name: 'Empty Response Retry', file: 'test-empty-response-retry.cjs' },
|
||||
{ name: 'Schema Sanitizer', file: 'test-schema-sanitizer.cjs' }
|
||||
{ name: 'Schema Sanitizer', file: 'test-schema-sanitizer.cjs' },
|
||||
{ name: 'Streaming Whitespace', file: 'test-streaming-whitespace.cjs' }
|
||||
];
|
||||
|
||||
async function runTest(test) {
|
||||
|
||||
Reference in New Issue
Block a user