mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 15:30:39 +00:00
fix: strip leading whitespace in block streaming reply path
The block streaming delivery path (onBlockReply) bypasses sanitizeUserFacingText, so the trimStart fix from #16158/#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.
This commit is contained in:
@@ -414,7 +414,7 @@ export async function runAgentTurnWithFallback(params: {
|
||||
|
||||
const blockPayload: ReplyPayload = params.applyReplyToMode({
|
||||
...taggedPayload,
|
||||
text: cleaned,
|
||||
text: cleaned?.trimStart(),
|
||||
audioAsVoice: Boolean(parsed.audioAsVoice || payload.audioAsVoice),
|
||||
replyToId: taggedPayload.replyToId ?? parsed.replyToId,
|
||||
replyToTag: taggedPayload.replyToTag || parsed.replyToTag,
|
||||
|
||||
Reference in New Issue
Block a user