Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feat: Hide the autoplay switch for message operators in webhook mode. #10427 (#12216)

balibabufd53b8319067
diff --git a/web/src/pages/agent/form/message-form/index.tsx b/web/src/pages/agent/form/message-form/index.tsx
index 7b09d52f23..87071e5780 100644
--- a/web/src/pages/agent/form/message-form/index.tsx
+++ b/web/src/pages/agent/form/message-form/index.tsx
@@ -60,7 +60,8 @@ function MessageForm({ node }: INextOperatorForm) {
control: form.control,
});
- const showWebhookResponseStatus = useShowWebhookResponseStatus(form);
+ const { showWebhookResponseStatus, isWebhookMode } =
+ useShowWebhookResponseStatus(form);
return (
<Form {...form}>
@@ -108,7 +109,7 @@ function MessageForm({ node }: INextOperatorForm) {
</div>
<FormMessage />
</FormItem>
- {!showWebhookResponseStatus && (
+ {!isWebhookMode && (
<>
<FormItem>
<FormLabel tooltip={t('flow.downloadFileTypeTip')}>
diff --git a/web/src/pages/agent/form/message-form/use-show-response-status.ts b/web/src/pages/agent/form/message-form/use-show-response-status.ts
index f46e418d0c..830fffff15 100644
--- a/web/src/pages/agent/form/message-form/use-show-response-status.ts
+++ b/web/src/pages/agent/form/message-form/use-show-response-status.ts
@@ -7,18 +7,20 @@ import {
WebhookExecutionMode,
} from '../../constant';
import useGraphStore from '../../store';
-import { BeginFormSchemaType } from '../begin-form/schema';
export function useShowWebhookResponseStatus(form: UseFormReturn<any>) {
const getNode = useGraphStore((state) => state.getNode);
+ const formData = getNode(BeginId)?.data.form;
+
+ const isWebhookMode = formData?.mode === AgentDialogueMode.Webhook;
+
const showWebhookResponseStatus = useMemo(() => {
- const formData: BeginFormSchemaType = getNode(BeginId)?.data.form;
return (
- formData?.mode === AgentDialogueMode.Webhook &&
+ isWebhookMode &&
formData?.execution_mode === WebhookExecutionMode.Streaming
);
- }, [getNode]);
+ }, [formData?.execution_mode, isWebhookMode]);
useEffect(() => {
if (showWebhookResponseStatus && isEmpty(form.getValues('status'))) {
@@ -26,5 +28,5 @@ export function useShowWebhookResponseStatus(form: UseFormReturn<any>) {
}
}, [form, showWebhookResponseStatus]);
- return showWebhookResponseStatus;
+ return { showWebhookResponseStatus, isWebhookMode };
}