feat(assistant): больше рабочей памяти (~14 сообщений) + оформление сноски

История разговора расширена с 6 до 14 сообщений (фронт _chat.slice и бэкенд
история в ask/askStream). Сноска о памяти переоформлена: иконка-история + чище
текст, акцент на количестве.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-06-24 22:56:51 +03:00
parent b310029e8d
commit c045ea02b0
2 changed files with 9 additions and 6 deletions
@@ -707,7 +707,7 @@ async function ask(req, res) {
const pageCtx = String((req.body && req.body.context) || '').slice(0, 4000);
const mode = ['hint', 'check'].includes(req.body && req.body.mode) ? req.body.mode : 'answer';
let history = (req.body && req.body.history);
history = Array.isArray(history) ? history.slice(-6) : [];
history = Array.isArray(history) ? history.slice(-14) : [];
const hits = searchFaq(q, 3);
const faqJson = hits.map(h => ({ id: h.id, q: h.q, a: h.a, url: h.url || null }));
@@ -769,7 +769,7 @@ async function askStream(req, res) {
const pageCtx = String((req.body && req.body.context) || '').slice(0, 4000);
const mode = ['hint', 'check'].includes(req.body && req.body.mode) ? req.body.mode : 'answer';
let history = (req.body && req.body.history);
history = Array.isArray(history) ? history.slice(-6) : [];
history = Array.isArray(history) ? history.slice(-14) : [];
const hits = searchFaq(q, 3);
const faqJson = hits.map(h => ({ id: h.id, q: h.q, a: h.a, url: h.url || null }));
sse('meta', { answers: faqJson });