fix: handle missing arguments in MCP tool calls to prevent GUI crash (#7143)
Signed-off-by: 青雲 <137844255@qq.com>
This commit is contained in:
@@ -518,7 +518,7 @@ function ToolCallView({
|
|||||||
|
|
||||||
// Function to create a descriptive representation of what the tool is doing
|
// Function to create a descriptive representation of what the tool is doing
|
||||||
const getToolDescription = (): string | null => {
|
const getToolDescription = (): string | null => {
|
||||||
const args = toolCall.arguments as Record<string, ToolCallArgumentValue>;
|
const args = (toolCall.arguments ?? {}) as Record<string, ToolCallArgumentValue>;
|
||||||
const toolName = getToolName(toolCall.name);
|
const toolName = getToolName(toolCall.name);
|
||||||
|
|
||||||
const getStringValue = (value: ToolCallArgumentValue): string => {
|
const getStringValue = (value: ToolCallArgumentValue): string => {
|
||||||
|
|||||||
Reference in New Issue
Block a user