Commit bc58df8
cellwebb
fix(agent): preserve spaces while stripping only newlines for alignment
Previous fix used lstrip() which removed ALL leading whitespace, including
spaces between words when streaming content chunk by chunk. This caused
words to run together, e.g., 'test' + ' here' became 'testhere'.
Now we only strip newline and carriage return characters (\n\r) while
preserving spaces and other whitespace that are part of the actual content.
This ensures:
- Content appears on same line as [📎] header
- Proper spacing between words is maintained
- Only problematic leading newlines are removed for alignment
Fixes the word spacing regression introduced in the alignment fix.1 parent 8138528 commit bc58df8
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
321 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
322 | 323 | | |
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
329 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| |||
0 commit comments