Hide untagged reasoning dumps in chat

This commit is contained in:
pewdiepie-archdaemon
2026-07-03 03:59:42 +00:00
parent cf85c42195
commit 5f6e6a2c4a
+6 -1
View File
@@ -165,7 +165,7 @@ export function hasUnclosedThinkTag(text) {
}
export function startsWithReasoningPrefix(text) {
return /^\s*(?:thinking(?:\s+process)?\s*:|the user |i need |i should |i will |they are |the question |i can )/i.test(text || '');
return /^\s*(?:thinking(?:\s+process)?\s*:|the user |user wants|we need |i need |i should |i will |i'll |i am going |let me (?:think|look|see|check|read|review|analyze|parse|figure|draft|write)|they are |the question |i can )/i.test(text || '');
}
export function normalizeThinkingMarkup(text) {
@@ -236,6 +236,11 @@ function normalizePlainThinking(text) {
}
}
if (/^\s*(?:thinking(?:\s+process)?\s*:|the user |user wants|we need |let me (?:think|look|see|check|read|review|analyze|parse|figure|draft|write)|i need to |i should |i will |i'll |i am going )/i.test(trimmed)) {
const thinkBlock = withoutPrefix.trim();
if (thinkBlock) return `<think>${thinkBlock}</think>`;
}
return text;
}