fix: strip leading empty lines in sanitizeUserFacingText#16280
Merged
fix: strip leading empty lines in sanitizeUserFacingText#16280
Conversation
PR SummaryLow Risk Overview Updates the sanitize E2E coverage to match the new behavior and tweaks the Written by Cursor Bugbot for commit 5d29c8f. This will update automatically on new commits. Configure here. |
hamidzr
pushed a commit
to hamidzr/openclaw
that referenced
this pull request
Feb 14, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj)
mcinteerj
added a commit
to mcinteerj/openclaw
that referenced
this pull request
Feb 14, 2026
The block streaming delivery path (onBlockReply) bypasses sanitizeUserFacingText, so the trimStart fix from openclaw#16158/openclaw#16280 doesn't apply to users with blockStreaming enabled (the default). Adds trimStart() to the cleaned text in the block reply payload construction, consistent with the non-streaming path.
mcinteerj
added a commit
to mcinteerj/openclaw
that referenced
this pull request
Feb 14, 2026
The block streaming delivery path (onBlockReply) bypasses sanitizeUserFacingText, so the trimStart fix from openclaw#16158/openclaw#16280 doesn't apply to users with blockStreaming enabled (the default). Adds trimStart() to the cleaned text in the block reply payload construction, consistent with the non-streaming path.
mverrilli
pushed a commit
to mverrilli/openclaw
that referenced
this pull request
Feb 14, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj)
akoscz
pushed a commit
to akoscz/openclaw
that referenced
this pull request
Feb 15, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj)
sebslight
pushed a commit
to mcinteerj/openclaw
that referenced
this pull request
Feb 15, 2026
The block streaming delivery path (onBlockReply) bypasses sanitizeUserFacingText, so the trimStart fix from openclaw#16158/openclaw#16280 doesn't apply to users with blockStreaming enabled (the default). Adds trimStart() to the cleaned text in the block reply payload construction, consistent with the non-streaming path.
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj)
snowzlm
pushed a commit
to snowzlm/openclaw
that referenced
this pull request
Feb 15, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj)
6 tasks
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 1, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) (cherry picked from commit 50a6e0e) # Conflicts: # CHANGELOG.md
hughdidit
pushed a commit
to hughdidit/DAISy-Agency
that referenced
this pull request
Mar 3, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) (cherry picked from commit 50a6e0e) # Conflicts: # CHANGELOG.md
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj) * fix: strip leading empty lines in sanitizeUserFacingText (openclaw#16158) (thanks @mcinteerj)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports #16158 to a maintainer branch, strips leading empty lines (not full trimStart) and normalizes whitespace-only outputs to empty.
Thanks @mcinteerj.
Greptile Overview
Greptile Summary
Refines
sanitizeUserFacingTextto strip only leading blank lines instead of all leading whitespace. This preserves indentation on the first content line (important for markdown/code blocks) while still removing spurious empty lines from LLM output.src/agents/pi-embedded-helpers/errors.ts: Replaces.trimStart()with a regex (/^(?:[ \t]*\r?\n)+/) that removes leading blank/whitespace-only lines without clobbering first-line indentation. Also reorders the operation to strip leading lines before passing tocollapseConsecutiveDuplicateBlocks.Confidence Score: 5/5
.trimStart(). The regex is correct, the test was updated to reflect the new behavior, and the CHANGELOG accurately describes the change. No callers are affected negatively — the only observable difference is that leading indentation on the first content line is now preserved, which is the intended improvement.Last reviewed commit: 5d29c8f