修复: 审批浮窗 reason 字段缺失(push 补 reason)+ 空态文案

This commit is contained in:
lxy
2026-08-01 15:54:32 +08:00
parent 1ddf48d40f
commit dbd226b403
4 changed files with 20 additions and 2 deletions
+5
View File
@@ -520,6 +520,11 @@ function handleToolEvent(event: AiChatEvent): boolean {
args: event.args,
status: 'pending_approval',
kind: event.kind ?? 'risk',
// BUG-260624-03(根因3):reason 必须写入 info,否则浮窗 ApprovalPopup.vue
// 的 tc.reason 永远空(后端 build_approval_reason 生成的风险说明丢失)。
// tc.reason 与 pendingApprovals[].reason 是两条独立赋值路径:tc 走 findToolCall,
// 浮窗走主窗口推送的 pendingApprovals 快照,后者此前漏写 reason。
reason: event.reason,
}
state.pendingApprovals.push(info)
const tc = findToolCall(event.id)