重构: 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

@@ -195,7 +195,7 @@ export type AiChatEvent = ({
} | {
type: 'AiToolCallCompleted'; id: string; result: unknown
} | {
type: 'AiApprovalRequired'; id: string; name: string; args: unknown; reason: string
type: 'AiApprovalRequired'; id: string; name: string; args: unknown; reason: string; diff?: string
} | {
type: 'AiApprovalResult'; id: string; approved: boolean
} | {
@@ -239,6 +239,9 @@ export interface AiToolCallInfo {
result?: unknown
/** 审批风险说明AiApprovalRequired 时填充) */
reason?: string
/** AE-2025-03write_file 行级 unified diff旧文件 vs 新内容),审批卡即时预览。
* 旧文件不存在(新建)或非 write_file 为 undefined前端回退显新 content。 */
diff?: string
}
/** 对话列表摘要 */