diff --git a/static/messages.js b/static/messages.js index de414ff3..3e3a39d8 100644 --- a/static/messages.js +++ b/static/messages.js @@ -4386,7 +4386,7 @@ function attachLiveStream(activeSid, streamId, uploaded=[], options={}){ s=s.replace(/<(?:\s*|\s*DSML\s*[||]\s*)?function_calls(?:>|$)[\s\S]*$/i,''); // Remove malformed DSML tag fragments like "<|DSML |" that can leak in tokens. s=s.replace(/<\s*|\s*DSML\s*[||]\s*/gi,''); - return s.trim(); + return s.replace(/^\s+/, ''); } function _streamDisplay(){ return _extractInlineThinkingFromContent(_stripXmlToolCalls(assistantText), liveReasoningText, {streaming:true}).content; diff --git a/static/ui.js b/static/ui.js index 56af87da..96ca5bce 100644 --- a/static/ui.js +++ b/static/ui.js @@ -7496,7 +7496,7 @@ function _stripXmlToolCallsDisplay(s){ s=s.replace(/<(?:\s*|\s*DSML\s*[||]\s*)?function_calls(?:>|$)[\s\S]*$/i,''); // Remove malformed DSML tag fragments like "<|DSML |" that can leak in tokens. s=s.replace(/<\s*|\s*DSML\s*[||]\s*/gi,''); - return s.trim(); + return s.replace(/^\s+/, ''); } function _sanitizeThinkingDisplayText(text){