Skip to content

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

Fix: Agent - Start Component - When an input variable is set to optional: if a value is entered and then deleted, clicking "Next" triggers a "required field" error. (#20820)

balibabu8079fe51c5f5
diff --git a/web/src/pages/agent/debug-content/index.tsx b/web/src/pages/agent/debug-content/index.tsx
index b5ce381270..838447c375 100644
--- a/web/src/pages/agent/debug-content/index.tsx
+++ b/web/src/pages/agent/debug-content/index.tsx
@@ -81,7 +81,10 @@ const DebugContent = ({
}
if (cur.optional) {
- fieldSchema = fieldSchema.optional();
+ fieldSchema = z.preprocess(
+ (val) => (val === '' ? undefined : val),
+ fieldSchema.optional(),
+ );
}
const index = idx.toString();