diff --git a/src/composables/ai/useAiEvents.ts b/src/composables/ai/useAiEvents.ts index a26af5b..2c07c9b 100644 --- a/src/composables/ai/useAiEvents.ts +++ b/src/composables/ai/useAiEvents.ts @@ -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) diff --git a/src/i18n/en/aiChat.ts b/src/i18n/en/aiChat.ts index e17182b..6a21b60 100644 --- a/src/i18n/en/aiChat.ts +++ b/src/i18n/en/aiChat.ts @@ -57,6 +57,8 @@ export default { popupTagPath: 'Path auth', popupTagRisk: 'Risk action', popupOpenPanel: 'Open approval panel', + // 根因1:首屏空态友好文案(数据未到达时,替代裸 spinner) + popupEmptyHint: 'Waiting for approval data…', // ── Provider status ── clickToSwitchProvider: 'Click to switch provider', diff --git a/src/i18n/zh-CN/aiChat.ts b/src/i18n/zh-CN/aiChat.ts index ee01e5c..e47ac60 100644 --- a/src/i18n/zh-CN/aiChat.ts +++ b/src/i18n/zh-CN/aiChat.ts @@ -57,6 +57,8 @@ export default { popupTagPath: '路径授权', popupTagRisk: '风险操作', popupOpenPanel: '打开审批面板', + // 根因1:首屏空态友好文案(数据未到达时,替代裸 spinner) + popupEmptyHint: '等待审批数据…', // ── Provider 状态 ── clickToSwitchProvider: '点击切换 Provider', diff --git a/src/views/ApprovalPopup.vue b/src/views/ApprovalPopup.vue index c09b87a..c9ffa1f 100644 --- a/src/views/ApprovalPopup.vue +++ b/src/views/ApprovalPopup.vue @@ -31,6 +31,7 @@