fix(inbound): preserve literal backslash-n sequences in Windows paths#11547
Merged
steipete merged 3 commits intoopenclaw:mainfrom Feb 13, 2026
Merged
fix(inbound): preserve literal backslash-n sequences in Windows paths#11547steipete merged 3 commits intoopenclaw:mainfrom
steipete merged 3 commits intoopenclaw:mainfrom
Conversation
88f4922 to
314df41
Compare
079cb94 to
6931752
Compare
6931752 to
3b0ba41
Compare
a7dabf3 to
9885be5
Compare
The normalizeInboundTextNewlines function was converting literal backslash-n
sequences (\n) to actual newlines, corrupting Windows paths like
C:\Work\nxxx\README.md when sent through WebUI.
This fix removes the .replaceAll("\\n", "\n") operation, preserving
literal backslash-n sequences while still normalizing actual CRLF/CR to LF.
Fixes openclaw#7968
9885be5 to
64b63d9
Compare
Contributor
zhangyang-crazy-one
pushed a commit
to zhangyang-crazy-one/openclaw
that referenced
this pull request
Feb 13, 2026
…openclaw#11547) * fix(inbound): preserve literal backslash-n sequences in Windows paths The normalizeInboundTextNewlines function was converting literal backslash-n sequences (\n) to actual newlines, corrupting Windows paths like C:\Work\nxxx\README.md when sent through WebUI. This fix removes the .replaceAll("\\n", "\n") operation, preserving literal backslash-n sequences while still normalizing actual CRLF/CR to LF. Fixes openclaw#7968 * fix(test): set RawBody to Windows path so BodyForAgent fallback chain tests correctly * fix: tighten Windows path newline regression coverage (openclaw#11547) (thanks @mcaxtr) --------- Co-authored-by: Peter Steinberger <[email protected]>
steipete
added a commit
to azade-c/openclaw
that referenced
this pull request
Feb 14, 2026
…openclaw#11547) * fix(inbound): preserve literal backslash-n sequences in Windows paths The normalizeInboundTextNewlines function was converting literal backslash-n sequences (\n) to actual newlines, corrupting Windows paths like C:\Work\nxxx\README.md when sent through WebUI. This fix removes the .replaceAll("\\n", "\n") operation, preserving literal backslash-n sequences while still normalizing actual CRLF/CR to LF. Fixes openclaw#7968 * fix(test): set RawBody to Windows path so BodyForAgent fallback chain tests correctly * fix: tighten Windows path newline regression coverage (openclaw#11547) (thanks @mcaxtr) --------- Co-authored-by: Peter Steinberger <[email protected]>
4 tasks
GwonHyeok
pushed a commit
to learners-superpumped/openclaw
that referenced
this pull request
Feb 15, 2026
…openclaw#11547) * fix(inbound): preserve literal backslash-n sequences in Windows paths The normalizeInboundTextNewlines function was converting literal backslash-n sequences (\n) to actual newlines, corrupting Windows paths like C:\Work\nxxx\README.md when sent through WebUI. This fix removes the .replaceAll("\\n", "\n") operation, preserving literal backslash-n sequences while still normalizing actual CRLF/CR to LF. Fixes openclaw#7968 * fix(test): set RawBody to Windows path so BodyForAgent fallback chain tests correctly * fix: tighten Windows path newline regression coverage (openclaw#11547) (thanks @mcaxtr) --------- Co-authored-by: Peter Steinberger <[email protected]>
cloud-neutral
pushed a commit
to cloud-neutral-toolkit/openclawbot.svc.plus
that referenced
this pull request
Feb 15, 2026
…openclaw#11547) * fix(inbound): preserve literal backslash-n sequences in Windows paths The normalizeInboundTextNewlines function was converting literal backslash-n sequences (\n) to actual newlines, corrupting Windows paths like C:\Work\nxxx\README.md when sent through WebUI. This fix removes the .replaceAll("\\n", "\n") operation, preserving literal backslash-n sequences while still normalizing actual CRLF/CR to LF. Fixes openclaw#7968 * fix(test): set RawBody to Windows path so BodyForAgent fallback chain tests correctly * fix: tighten Windows path newline regression coverage (openclaw#11547) (thanks @mcaxtr) --------- Co-authored-by: Peter Steinberger <[email protected]>
jiulingyun
added a commit
to jiulingyun/openclaw-cn
that referenced
this pull request
Feb 15, 2026
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.
Summary
\nsequences (likeC:\Work\nxxx\README.md) being corrupted when sent through WebUInormalizeInboundTextNewlines()function was converting literal backslash-n (\n) to actual newlines, breaking pathsRoot Cause
The function had
.replaceAll("\\n", "\n")which converted literal backslash-n sequences to newlines. While the intent was to normalize escaped newlines, this also corrupted:C:\Work\nxxx→C:\Work<newline>xxx\nsequencesFix
Removed the
.replaceAll("\\n", "\n")operation. The function now only normalizes actual newline characters (CRLF and CR to LF), preserving literal backslash-n sequences.Test Plan
inbound-text.test.tscovering Windows path preservationinbound.test.tsforfinalizeInboundContextwith Windows pathspnpm build && pnpm check && pnpm test)Fixes #7968
Greptile Overview
Greptile Summary
This PR updates
normalizeInboundTextNewlines()to only normalize actual newline characters (CRLF/CR → LF) and stop converting literal\\nsequences into real newlines. This prevents Windows paths likeC:\\Work\\nxxx\\README.mdfrom being corrupted when sent through the WebUI.Tests were updated/added to cover both direct calls to
normalizeInboundTextNewlines()and thefinalizeInboundContext()flow, ensuring CRLF normalization still works while preserving literal backslash-n sequences in paths and messages.Confidence Score: 5/5
\\ninto newlines, and the remaining CRLF/CR normalization behavior is preserved.