feat(agent): safety check display

* fix(i18n): add missing agent tool step translations for zh-TW, pt-BR, it, ja

* propagate explainData to agent step items for ExplainPlanViewer

* feat(ai): show safety check result for execute_query tool steps
This commit is contained in:
Abeautifulsnow
2026-06-16 13:56:16 +08:00
committed by GitHub
parent 558b9301a2
commit ec28005f20
7 changed files with 18 additions and 2 deletions
@@ -346,10 +346,14 @@ function agentEventToStep(event: AgentEvent, index: number): AiAgentStepItem | u
if (event.type !== "tool_call_start" && event.type !== "tool_call_end") return undefined;
const isExecuteQuery = event.tool_name === "execute_query";
const labelKey = event.type === "tool_call_start" ? "ai.agentSteps.callingTool" : isExecuteQuery ? (event.is_error ? "ai.agentSteps.executeBlocked" : "ai.agentSteps.executeSafe") : event.is_error ? "ai.agentSteps.toolError" : "ai.agentSteps.toolDone";
const tone = (event.type === "tool_call_start" ? "active" : event.is_error ? "danger" : "success") as AiAgentStepTone;
return {
key: `${event.tool_call_id || ""}-${event.type}`,
labelKey: event.type === "tool_call_start" ? "ai.agentSteps.callingTool" : event.is_error ? "ai.agentSteps.toolError" : "ai.agentSteps.toolDone",
tone: (event.type === "tool_call_start" ? "active" : event.is_error ? "danger" : "success") as AiAgentStepTone,
labelKey,
tone,
titleKey: undefined,
titleParams: { tool: event.tool_name || "" },
toolName: event.tool_name,
+2
View File
@@ -986,6 +986,8 @@
callingTool: "Calling tool...",
toolDone: "Tool completed",
toolError: "Tool error",
executeSafe: "Safety check passed · Executed",
executeBlocked: "Blocked by safety check",
contextCompacted: "Context compressed",
},
agentStepTitles: {
+2
View File
@@ -933,6 +933,8 @@
callingTool: "Chiamata strumento...",
toolDone: "Strumento completato",
toolError: "Errore strumento",
executeSafe: "Controllo di sicurezza superato · Eseguito",
executeBlocked: "Bloccato dal controllo di sicurezza",
contextCompacted: "Contesto compresso",
},
agentStepTitles: {
+2
View File
@@ -983,6 +983,8 @@ export default {
callingTool: "ツールを呼び出し中...",
toolDone: "ツール完了",
toolError: "ツールエラー",
executeSafe: "安全チェック通過 · 実行済み",
executeBlocked: "安全チェックによりブロック",
contextCompacted: "コンテキストを圧縮しました",
},
agentStepTitles: {
+2
View File
@@ -933,6 +933,8 @@
callingTool: "Chamando ferramenta...",
toolDone: "Ferramenta concluída",
toolError: "Erro da ferramenta",
executeSafe: "Verificação de segurança aprovada · Executado",
executeBlocked: "Bloqueado pela verificação de segurança",
contextCompacted: "Contexto compactado",
},
agentStepTitles: {
+2
View File
@@ -985,6 +985,8 @@
callingTool: "正在调用工具...",
toolDone: "工具调用完成",
toolError: "工具调用出错",
executeSafe: "安全检查通过 · 已执行",
executeBlocked: "安全检查拦截",
contextCompacted: "上下文已压缩",
},
agentStepTitles: {
+2
View File
@@ -912,6 +912,8 @@
callingTool: "正在調用工具...",
toolDone: "工具調用完成",
toolError: "工具調用出錯",
executeSafe: "安全檢查通過 · 已執行",
executeBlocked: "安全檢查攔截",
contextCompacted: "上下文已壓縮",
},
agentStepTitles: {