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 authored and GitHub committed 2026-06-16 13:56:16 +08:00
1 parent 558b9301a2
commit ec28005f20
7 files changed
+18 -2

No files matched your search

@@ -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,