feat: Enhance event duration tracking and UI components in chat

- Added duration tracking for agent steps and tool calls, improving event data accuracy.
- Updated AgentStreamDisplay and ToolResultRenderer components to include fallback headers and improved output styling.
- Refactored duration handling in the agent engine and session management to ensure consistent duration reporting.
- Enhanced UI elements for better user experience, including scrollable output areas and improved tooltip visibility.
This commit is contained in:
wizardchen
2025-11-12 14:27:00 +08:00
parent 05154c8d75
commit 38beca1146
6 changed files with 219 additions and 81 deletions
+2 -2
View File
@@ -29,12 +29,12 @@ func NewMCPTool(service *types.MCPService, mcpTool *types.MCPTool, mcpManager *m
}
// Name returns the unique name for this tool
// Format: mcp_{service_name}_{tool_name}
// Format: mcp.{service_name}.{tool_name}
func (t *MCPTool) Name() string {
// Sanitize service name and tool name to create a valid identifier
serviceName := sanitizeName(t.service.Name)
toolName := sanitizeName(t.mcpTool.Name)
return fmt.Sprintf("mcp_%s_%s", serviceName, toolName)
return fmt.Sprintf("mcp.%s.%s", serviceName, toolName)
}
// Description returns the tool description