重构: AI聊天可靠性批次(审批累计计数/write_file diff预览/会话隔离补清/token缓存)

This commit is contained in:
2026-06-16 19:56:29 +08:00
parent ba7f35552b
commit d00b30f0ba
12 changed files with 238 additions and 45 deletions

View File

@@ -36,6 +36,13 @@ async function newConversation() {
state.currentText = ''
state.pendingApprovals = []
state.streaming = false
// F-260616-09(A 路线):补漏清字段维持单例软隔离,解「新建会话上下文残留」。
// queue 清空防旧会话排队消息被带进新会话 drain;generatingConvId 清空防后台事件
// 错误路由;agentRound 复位 0;searchQuery 清空防新会话侧栏被旧搜索过滤。
state.queue = []
state.generatingConvId = null
state.agentRound = 0
state.searchQuery = ''
await loadConversations()
notifyConversationChanged()
}

View File

@@ -235,6 +235,8 @@ export function handleEvent(event: AiChatEvent) {
if (tc) {
tc.status = 'pending_approval'
tc.reason = event.reason
// AE-2025-03: write_file 审批注入行级 diff旧文件 vs 新内容),前端审批卡预览
if (event.diff) tc.diff = event.diff
}
// B-260616-12: 进入审批等待→取消该工具慢执行计时器(审批耗时由用户主导,非执行慢)
clearToolSlowTimer(event.id)