Gate 1 integration: shared streamdown config in reasoning, teaserText flattens \(...\)

This commit is contained in:
Amos
2026-08-22 09:42:39 +03:00
parent ef488224bc
commit 2c522116c0
3 changed files with 13 additions and 16 deletions
+3 -1
View File
@@ -60,7 +60,9 @@ export function QuestionDock({ toolName, toolCallId, input, expanded, onExpand,
/** A plain-text teaser of a question for the collapsed bar: unwrap math, flatten common LaTeX. */
function teaserText(q: string): string {
return q
.replace(/\$\$?([^$]*)\$\$?/g, "$1")
.replace(/\\\(([\s\S]*?)\\\)/g, "$1") // \(...\) inline math
.replace(/\\\[([\s\S]*?)\\\]/g, "$1") // \[...\] display math
.replace(/\$\$?([^$]*)\$\$?/g, "$1") // legacy $...$ (pre-switch sessions)
.replace(/\\frac\{([^{}]*)\}\{([^{}]*)\}/g, "$1/$2")
.replace(/\\([a-zA-Z]+)/g, "$1")
.replace(/[{}]/g, "")