From 504e453ae5de7e6faf21475935213073e01b5280 Mon Sep 17 00:00:00 2001 From: yungongzi Date: Fri, 11 Jul 2025 19:41:26 +0800 Subject: [PATCH] =?UTF-8?q?BugFix:=20=20AgentCreateBUGFix=EF=BC=9Arequired?= =?UTF-8?q?=20argument=20are=20missing:=20dsl;=20(#8794)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### AgentCreateBUGFix Because useFetchFlowTemplates is called both in the hooks and the AgentTemplateModal, and the ID of the empty template is generated via uuid, there may be cases where the IDs do not match. Report a BUG as follows: Prompt: 101 Required argument is missing: dsl; 52d79682-4e50-4863-8486-f1e154003043 _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: 海贼宅 --- web/src/pages/flow/list/agent-template-modal.tsx | 16 ++++++++++++---- web/src/pages/flow/list/hooks.ts | 1 + web/src/pages/flow/list/index.tsx | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/web/src/pages/flow/list/agent-template-modal.tsx b/web/src/pages/flow/list/agent-template-modal.tsx index 5a90d16c7..ac19ff0de 100644 --- a/web/src/pages/flow/list/agent-template-modal.tsx +++ b/web/src/pages/flow/list/agent-template-modal.tsx @@ -1,6 +1,7 @@ import { IModalManagerChildrenProps } from '@/components/modal-manager'; import { useSetModalState, useTranslate } from '@/hooks/common-hooks'; -import { useFetchFlowTemplates } from '@/hooks/flow-hooks'; +import { IFlowTemplate } from '@/interfaces/database/flow'; +// import { useFetchFlowTemplates } from '@/hooks/flow-hooks'; import { useSelectItem } from '@/hooks/logic-hooks'; import { Button, Card, Flex, List, Modal, Typography } from 'antd'; import { useCallback, useState } from 'react'; @@ -15,11 +16,18 @@ interface IProps extends Omit { loading: boolean; onOk: (name: string, templateId: string) => void; showModal?(): void; + templateList: IFlowTemplate[]; } -const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => { +const AgentTemplateModal = ({ + visible, + hideModal, + loading, + onOk, + templateList, +}: IProps) => { const { t } = useTranslate('common'); - const { data: list } = useFetchFlowTemplates(); + // const { data: list } = useFetchFlowTemplates(); const { selectedId, handleItemClick } = useSelectItem(''); const [checkedId, setCheckedId] = useState(''); @@ -62,7 +70,7 @@ const AgentTemplateModal = ({ visible, hideModal, loading, onOk }: IProps) => { ( { onFlowOk, flowSettingVisible, hideFlowSettingModal, + templateList: list, showFlowSettingModal: showFileRenameModal, }; }; diff --git a/web/src/pages/flow/list/index.tsx b/web/src/pages/flow/list/index.tsx index 0c624e65f..9bc0a845d 100644 --- a/web/src/pages/flow/list/index.tsx +++ b/web/src/pages/flow/list/index.tsx @@ -24,6 +24,7 @@ const FlowList = () => { hideFlowSettingModal, flowSettingVisible, flowSettingLoading, + templateList, onFlowOk, } = useSaveFlow(); const { t } = useTranslate('flow'); @@ -110,6 +111,7 @@ const FlowList = () => { onOk={onFlowOk} loading={flowSettingLoading} hideModal={hideFlowSettingModal} + templateList={templateList} > )}