Skip to content

Commit 4b76a42

Browse files
committed
style: format streamed reply boundary repair
1 parent d20b0e1 commit 4b76a42

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎src/agents/embedded-agent-subscribe.stream-rendering.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -478,13 +478,13 @@ export function createStreamRendering({
478478
markBlockReplyTextHandled();
479479
};
480480

481-
function trimBlockReplyTextPreservingParagraphSuffix(text: string): string {
482-
const paragraphSuffix = text.match(/\n[\t ]*\n+$/)?.[0];
483-
if (!paragraphSuffix) {
484-
return text.trimEnd();
481+
function trimBlockReplyTextPreservingParagraphSuffix(text: string): string {
482+
const paragraphSuffix = text.match(/\n[\t ]*\n+$/)?.[0];
483+
if (!paragraphSuffix) {
484+
return text.trimEnd();
485+
}
486+
return `${text.slice(0, -paragraphSuffix.length).trimEnd()}${paragraphSuffix}`;
485487
}
486-
return `${text.slice(0, -paragraphSuffix.length).trimEnd()}${paragraphSuffix}`;
487-
}
488488

489489
const consumeReplyDirectives = (text: string, options?: { final?: boolean }) =>
490490
replyDirectiveAccumulator.consume(text, options);

0 commit comments

Comments
 (0)