|
7 | 7 | from textual.containers import Container, Horizontal, Vertical |
8 | 8 | from textual.reactive import reactive |
9 | 9 | from textual.widgets import Button, Select, TabbedContent, TabPane, TextArea |
10 | | -from uipath.runtime import UiPathRuntimeFactoryProtocol |
| 10 | +from uipath.runtime import UiPathRuntimeFactoryProtocol, UiPathRuntimeProtocol |
11 | 11 |
|
12 | 12 | from uipath.dev.ui.widgets.json_input import JsonInput |
13 | 13 |
|
@@ -182,18 +182,22 @@ async def _load_schema_and_update_input(self, entrypoint: str) -> None: |
182 | 182 | schema = self.entrypoint_schemas.get(entrypoint) |
183 | 183 |
|
184 | 184 | if schema is None: |
| 185 | + runtime: UiPathRuntimeProtocol | None = None |
185 | 186 | try: |
186 | | - runtime = await self._runtime_factory.new_runtime(entrypoint) |
| 187 | + runtime = await self._runtime_factory.new_runtime( |
| 188 | + entrypoint, runtime_id="default" |
| 189 | + ) |
187 | 190 | schema_obj = await runtime.get_schema() |
188 | 191 |
|
189 | 192 | input_schema = schema_obj.input or {} |
190 | 193 | self.entrypoint_schemas[entrypoint] = input_schema |
191 | 194 | schema = input_schema |
192 | | - |
193 | | - await runtime.dispose() |
194 | 195 | except Exception: |
195 | 196 | schema = {} |
196 | 197 | self.entrypoint_schemas[entrypoint] = schema |
| 198 | + finally: |
| 199 | + if runtime is not None: |
| 200 | + await runtime.dispose() |
197 | 201 |
|
198 | 202 | json_input.text = json.dumps( |
199 | 203 | mock_json_from_schema(schema), |
|
0 commit comments