mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-16 16:30:15 +01:00
🔧 fix: Await MCP Instructions and Filter Malformed Tool Calls (#10485)
* fix: Await MCP instructions formatting in AgentClient * fix: don't render or aggregate malformed tool calls * fix: implement filter for malformed tool call content parts and add tests
This commit is contained in:
parent
aff3cd3667
commit
cabc8afeac
10 changed files with 467 additions and 9 deletions
|
|
@ -144,6 +144,7 @@ const Part = memo(
|
|||
attachments={attachments}
|
||||
auth={toolCall.auth}
|
||||
expires_at={toolCall.expires_at}
|
||||
isLast={isLast}
|
||||
/>
|
||||
);
|
||||
} else if (toolCall.type === ToolCallTypes.CODE_INTERPRETER) {
|
||||
|
|
@ -192,6 +193,7 @@ const Part = memo(
|
|||
args={toolCall.function.arguments as string}
|
||||
name={toolCall.function.name}
|
||||
output={toolCall.function.output}
|
||||
isLast={isLast}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import { logger, cn } from '~/utils';
|
|||
|
||||
export default function ToolCall({
|
||||
initialProgress = 0.1,
|
||||
isLast = false,
|
||||
isSubmitting,
|
||||
name,
|
||||
args: _args = '',
|
||||
|
|
@ -19,6 +20,7 @@ export default function ToolCall({
|
|||
auth,
|
||||
}: {
|
||||
initialProgress: number;
|
||||
isLast?: boolean;
|
||||
isSubmitting: boolean;
|
||||
name: string;
|
||||
args: string | Record<string, unknown>;
|
||||
|
|
@ -155,6 +157,10 @@ export default function ToolCall({
|
|||
};
|
||||
}, [showInfo, isAnimating]);
|
||||
|
||||
if (!isLast && (!function_name || function_name.length === 0) && !output) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="relative my-2.5 flex h-5 shrink-0 items-center gap-2.5">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue