From 53e395ca2ef1115084c9186e35a42f2cc0de7eb0 Mon Sep 17 00:00:00 2001 From: Yongteng Lei Date: Wed, 18 Mar 2026 14:22:13 +0800 Subject: [PATCH] Fix: cannot debug invoke component (#13649) ### What problem does this PR solve? Cannot debug invoke component. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- agent/component/invoke.py | 21 +++++++++++++++++++ .../form-sheet/single-debug-sheet/index.tsx | 1 - 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/agent/component/invoke.py b/agent/component/invoke.py index c24c91b16..65534abec 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 b65f67df7..51ff8eebc 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]" >