Revert "feat(tg): 思考块改为可折叠引用块(与工具调用区分)"

This reverts commit 6d00225cc4.
This commit is contained in:
RRRosmontis
2026-09-17 11:39:18 +08:00
parent 6d00225cc4
commit 566932e0ae
4 changed files with 16 additions and 94 deletions
+3 -11
View File
@@ -75,10 +75,8 @@ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const REASONING_QUOTE_MAX_CHARS = 800;
/**
* Assistant message → markdown for delivery. Reasoning (thinking) blocks are
* kept as EXPANDABLE quotes (`**>`…`||` per Telegram's native markdown spec,
* `<blockquote expandable>` in HTML mode) so they stay collapsed on the phone
* and visually distinct from tool-call quotes; ordinary quotes in assistant
* text remain plain blockquotes.
* kept, one `> ` quote line each — Telegram renders them as the accent-bar
* quote style the phone user expects for bash/thinking-style chatter.
*/
function contentToText(content) {
const parts = [];
@@ -92,13 +90,7 @@ function contentToText(content) {
continue;
if (thinking.length > REASONING_QUOTE_MAX_CHARS)
thinking = `${thinking.slice(0, REASONING_QUOTE_MAX_CHARS)}…`;
// `||` would open/close spoiler entities in native markdown — neutralize.
const lines = thinking.replace(/\|\|/g, '||').split('\n');
const last = lines.length - 1;
parts.push([
'**>💭 思考过程',
...lines.map((line, i) => `> ${line}${i === last ? '||' : ''}`),
].join('\n'));
parts.push(thinking.split('\n').map((line) => `> ${line}`).join('\n'));
}
}
return parts.join('\n\n');