修复: 上下文管理第二批(E5注入产物/E13超时收敛/E2降级透出)

- E5:[补充指令]与[系统恢复]同治三处——载入滤出/恢复回放剔除/
  首条任务消息排除(434c8c40占位实证),is_guide_artifact统一判据
- E13:同工具超时连败≥3跨签名聚合,执行前软收敛警告(治换档位调参
  逃逸,434c8c40 run_command 8连败实证)
- E2:压缩失败走关键词摘要兜底时新发AiContextDegraded,前端toast
  「上下文已降级」不再静默失忆(76730ce8 seq166实证)
- vite watch忽略target/(cargo编译写.o触发EBUSY杀dev进程)
- provider-list模板根div缺闭合补齐(拆分半成品断链)

验收:tool_failure 5/keyword_fallback 3/recovery 6 passed;vue-tsc EXIT 0
This commit is contained in:
lxy
2026-10-19 00:25:51 +08:00
parent 25ec9cf69a
commit eec5978fa7
13 changed files with 171 additions and 22 deletions
@@ -30,6 +30,8 @@ export interface ContextCallbacks {
onCleared?: (conversationId: string) => void
/** 错误(AiError,含压缩失败):仅在 loading 时置 false + toast */
onError?: (conversationId: string, message: string) => void
/** E2 压缩失败降级(AiContextDegraded):loop 仍在跑,仅提示上下文已降级不中断流 */
onContextDegraded?: (conversationId: string, reason: string) => void
}
let _contextCallbacks: ContextCallbacks = {}
@@ -344,6 +346,11 @@ export async function handleLifecycleEvent(event: AiChatEvent): Promise<boolean>
_contextCallbacks.onCleared?.(event.conversation_id || '')
return true
case 'AiContextDegraded':
// E2:压缩失败已走关键词摘要兜底,loop 继续——透出降级提示而非静默失忆
_contextCallbacks.onContextDegraded?.(event.conversation_id || '', event.reason || '')
return true
default:
return false
}