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:
Jake McInteer 2026-02-15 07:51:43 +13:00 committed by Sebastian
parent d31e0dee55
commit 8aeee98593
1 changed files with 1 additions and 1 deletions

View File

@ -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,