Skip to content

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

Fix: In the agent loop, if the await response is selected as the variable, the operator cannot be selected. #12656 (#12657)

balibabu99dae3c64c44
diff --git a/web/.eslintrc.cjs b/web/.eslintrc.cjs
index 0473e62460..689dec1fc3 100644
--- a/web/.eslintrc.cjs
+++ b/web/.eslintrc.cjs
@@ -53,10 +53,7 @@ module.exports = {
],
},
],
- 'react-refresh/only-export-components': [
- 'warn',
- { allowConstantExport: true },
- ],
+ 'react-refresh/only-export-components': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'check-file/filename-naming-convention': [
'error',
diff --git a/web/src/pages/agent/constant/index.tsx b/web/src/pages/agent/constant/index.tsx
index 845450ab3e..869f247c0b 100644
--- a/web/src/pages/agent/constant/index.tsx
+++ b/web/src/pages/agent/constant/index.tsx
@@ -1075,3 +1075,13 @@ export enum WebhookStatus {
Live = 'live',
Stopped = 'stopped',
}
+
+// Map BeginQueryType to TypesWithArray
+export const BeginQueryTypeMap = {
+ [BeginQueryType.Line]: TypesWithArray.String,
+ [BeginQueryType.Paragraph]: TypesWithArray.String,
+ [BeginQueryType.Options]: TypesWithArray.ArrayString,
+ [BeginQueryType.File]: 'File',
+ [BeginQueryType.Integer]: TypesWithArray.Number,
+ [BeginQueryType.Boolean]: TypesWithArray.Boolean,
+};
diff --git a/web/src/pages/agent/form/begin-form/parameter-dialog.tsx b/web/src/pages/agent/form/begin-form/parameter-dialog.tsx
index 88f239a4e7..c56f7a1f1d 100644
--- a/web/src/pages/agent/form/begin-form/parameter-dialog.tsx
+++ b/web/src/pages/agent/form/begin-form/parameter-dialog.tsx
@@ -96,7 +96,7 @@ function ParameterForm({
},
[],
);
- }, []);
+ }, [t]);
const type = useWatch({
control: form.control,
diff --git a/web/src/pages/agent/hooks/use-get-begin-query.tsx b/web/src/pages/agent/hooks/use-get-begin-query.tsx
index 5de22e0e97..9588ee90f9 100644
--- a/web/src/pages/agent/hooks/use-get-begin-query.tsx
+++ b/web/src/pages/agent/hooks/use-get-begin-query.tsx
@@ -18,6 +18,7 @@ import {
AgentVariableType,
BeginId,
BeginQueryType,
+ BeginQueryTypeMap,
JsonSchemaDataType,
Operator,
VariableType,
@@ -463,7 +464,14 @@ export function useGetVariableLabelOrTypeByValue({
const getType = useCallback(
(val?: string) => {
- return getItem(val)?.type || findAgentStructuredOutputTypeByValue(val);
+ const currentType =
+ getItem(val)?.type || findAgentStructuredOutputTypeByValue(val);
+
+ if (currentType && currentType in BeginQueryTypeMap) {
+ return BeginQueryTypeMap[currentType as BeginQueryType];
+ }
+
+ return currentType;
},
[findAgentStructuredOutputTypeByValue, getItem],
);