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)
This commit is contained in:
Yongteng Lei
2026-03-18 14:22:13 +08:00
committed by GitHub
parent 74866371ef
commit 53e395ca2e
2 changed files with 21 additions and 1 deletions

View File

@ -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()

View File

@ -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>