Skip to content

Commit 1f21974

Browse files
committed
Fix lift helper crash on model-level pydantic errors
`_navigable_path` unpacked `*prefix, leaf = loc` and crashed on empty loc tuples, which pydantic emits for `@model_validator` errors. Return early with no path components instead. Also fix `test_lift_handles_nested_conditional_drift` to not inherit the BASE_TOOL `shell_command` reference to `inputs.msg`, since the test's conditional-only input set doesn't declare it and the `_check_input_refs_and_outputs` validator (added after the test) now rejects it.
1 parent 78c8858 commit 1f21974

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/galaxy/tool_util_models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ def _navigable_path(value: Any, loc: tuple) -> Tuple[Optional[Any], List[Any]]:
279279
container of the leaf and the cleaned path components, or (None, []) if
280280
the path can't be resolved."""
281281
cur: Any = value
282+
if not loc:
283+
return cur, []
282284
*prefix, leaf = loc
283285
cleaned: List[Any] = []
284286
for step in prefix:

test/unit/tool_util_models/test_user_tool_source_response.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def test_lift_status_lifted_for_drift_only():
8686
def test_lift_handles_nested_conditional_drift():
8787
value = {
8888
**BASE_TOOL,
89+
"shell_command": "echo hello",
8990
"inputs": [
9091
{
9192
"type": "conditional",

0 commit comments

Comments
 (0)