🔀 fix: MCP Improvements, Auto-Save Drafts, Artifact Markup (#7040)

* feat: Update MCP tool creation to use lowercase provider name

* refactor: handle MCP image output edge cases where tool outputs must contain string responses

* feat: Drop 'anyOf' and 'oneOf' fields from JSON schema conversion

* feat: Transform 'oneOf' and 'anyOf' fields to Zod union in JSON schema conversion

* fix: artifactPlugin to replace textDirective with expected text, closes #7029

* fix: auto-save functionality to handle conversation transitions from pending drafts, closes #7027

* refactor: improve async handling during user disconnection process

* fix: use correct user ID variable for MCP tool calling

* fix: improve handling of pending drafts in auto-save functionality

* fix: add support for additional model names in getValueKey function

* fix: reset form values on agent deletion when no agents remain
This commit is contained in:
Danny Avila 2025-04-23 18:56:06 -04:00 committed by GitHub
parent 150116eefe
commit 7f1d01c35a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 856 additions and 73 deletions

View file

@ -1,3 +1,5 @@
import { useFormContext } from 'react-hook-form';
import { defaultAgentFormValues } from 'librechat-data-provider';
import type { Agent, AgentCreateParams } from 'librechat-data-provider';
import type { UseMutationResult } from '@tanstack/react-query';
import { OGDialog, OGDialogTrigger, Label } from '~/components/ui';
@ -18,6 +20,7 @@ export default function DeleteButton({
createMutation: UseMutationResult<Agent, Error, AgentCreateParams>;
}) {
const localize = useLocalize();
const { reset } = useFormContext();
const { showToast } = useToastContext();
const { conversation } = useChatContext();
const { setOption } = useSetIndexOptions();
@ -41,6 +44,10 @@ export default function DeleteButton({
const firstAgent = updatedList[0] as Agent | undefined;
if (!firstAgent) {
setCurrentAgentId(undefined);
reset({
...defaultAgentFormValues,
});
return setOption('agent_id')('');
}