fix(engine): 增量上下文作废按 sessionId 现查,修复编辑后仍发增量
getSession() 只查 sessions 表,返回对象没有 history 字段,contextIdOf 里 archivedCount(session.history) 恒得 0。编辑/删除/清空四处入口的 invalidateContext 于是全作用在 "…:0" 上,压缩过的会话真实 cid(如 "…:3031")从没被作废,编辑完仍旧发增量,relay 缓存里留着已删除的行,上游随即 tool_call_mismatch。 改为拿不到 history 时按 sessionId 现查 count(type='archived');runLoop 热路径仍走内存计数。另把「模型调用失败」文案落库标为 type='error_note':buildMessages 跳过、微信不外发,避免失败文案被当成模型回复带进后续轮次。
This commit is contained in:
@@ -489,7 +489,7 @@ function getTurn(bid) { return turnState.get(bid) || resetTurn(bid); }
|
||||
|
||||
// 投递前的内容归一(语义同旧 deliverNow):errAck / 空文本 → 不可投;富文本 blocks → 占位文案。
|
||||
function normalizeContent(m) {
|
||||
if (!m || m.type === 'errAck') return '';
|
||||
if (!m || m.type === 'errAck' || m.type === 'error_note') return '';
|
||||
let content = String(m.content || '').trim();
|
||||
if (!content) return '';
|
||||
if (content.startsWith('{"__blocks__"')) content = '【富文本消息,请到网页端查看】';
|
||||
|
||||
Reference in New Issue
Block a user