Skip to content

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

Fix: cannot debug invoke component (#13649)

Yongteng Lei53e395ca2ef1
diff --git a/agent/component/invoke.py b/agent/component/invoke.py
index c24c91b16d..65534abecc 100644
--- a/agent/component/invoke.py
+++ b/agent/component/invoke.py
@@ -54,6 +54,23 @@ class InvokeParam(ComponentParamBase):
class Invoke(ComponentBase, ABC):
component_name = "Invoke"
+ def get_input_form(self) -> dict[str, dict]:
+ res = {}
+ for item in self._param.variables or []:
+ if not isinstance(item, dict):
+ continue
+ ref = (item.get("ref") or "").strip()
+ if not ref or ref in res:
+ continue
+
+ elements = self.get_input_elements_from_text("{" + ref + "}")
+ element = elements.get(ref, {})
+ res[ref] = {
+ "type": "line",
+ "name": element.get("name") or item.get("key") or ref,
+ }
+ return res
+
@timeout(int(os.environ.get("COMPONENT_EXEC_TIMEOUT", 3)))
def _invoke(self, **kwargs):
if self.check_if_canceled("Invoke processing"):
@@ -63,8 +80,12 @@ class Invoke(ComponentBase, ABC):
for para in self._param.variables:
if para.get("value"):
args[para["key"]] = para["value"]
+ elif para.get("ref") in kwargs:
+ args[para["key"]] = kwargs[para["ref"]]
+ self.set_input_value(para["ref"], kwargs[para["ref"]])
else:
args[para["key"]] = self._canvas.get_variable_value(para["ref"])
+ self.set_input_value(para["ref"], args[para["key"]])
url = self._param.url.strip()
diff --git a/web/src/pages/agent/form-sheet/single-debug-sheet/index.tsx b/web/src/pages/agent/form-sheet/single-debug-sheet/index.tsx
index b65f67df73..51ff8eebcb 100644
--- a/web/src/pages/agent/form-sheet/single-debug-sheet/index.tsx
+++ b/web/src/pages/agent/form-sheet/single-debug-sheet/index.tsx
@@ -59,7 +59,6 @@ const SingleDebugSheet = ({
ok={onOk}
isNext={false}
loading={loading}
- submitButtonDisabled={list.length === 0}
className="flex-1 overflow-auto min-h-0 pb-5"
maxHeight="max-h-[83vh]"
></DebugContent>