新增: 压缩失败降级前端透出与vite看门修复

- E2:LLM压缩失败走关键词摘要兜底时新发AiContextDegraded事件,
  前端toast「上下文已降级」不再静默失忆(实证76730ce8 seq166
  用户被迫原句重发);不发AiError防误判生成结束
- keyword_fallback_commit返回inserted供emit判定,双调用点
  (LLM失败/provider重建失败)透出
- vite watch忽略target/:cargo编译写.o触发EBUSY杀掉dev进程

验收:cargo check 0 error;keyword_fallback 3 passed;vue-tsc EXIT 0
This commit is contained in:
lxy
2026-10-19 00:00:55 +08:00
parent e6ed13bb9a
commit 5cebfcd864
9 changed files with 58 additions and 6 deletions
+6
View File
@@ -46,6 +46,7 @@ async function initContextListener(callbacks: {
onCleared?: (conversationId: string) => void
onCompressed?: (conversationId: string, summary: string) => void
onError?: (conversationId: string, message: string) => void
onContextDegraded?: (conversationId: string, reason: string) => void
}): Promise<void> {
setContextCallbacks({
onCompressing: () => { isCompressing.value = true },
@@ -62,6 +63,11 @@ async function initContextListener(callbacks: {
autoCompressedFlashTimer = setTimeout(() => { autoCompressedFlash.value = false }, 4000)
},
onCleared: (convId) => callbacks.onCleared?.(convId),
onContextDegraded: (convId, reason) => {
// E2:压缩失败降级为关键词摘要兜底——复位 loading + 上抛 toast(不中断 LLM 流)
isCompressing.value = false
callbacks.onContextDegraded?.(convId, reason)
},
onError: (convId, message) => {
// AiError 也用于流式生成失败(useAiEvents 已处理);此处仅在压缩中时复位 + toast,
// 避免双重处理流式错误。