Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/uipath_langchain/agent/tools/static_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def apply_static_args(
# The array is empty. Updating it with jsonpath will leave it empty.
# We instead replace the empty array with a single static value
array_expr.update_or_create(sanitized_args, [value])
return sanitized_args
continue

expr.update_or_create(sanitized_args, value)

Expand Down
18 changes: 18 additions & 0 deletions tests/agent/tools/test_static_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,24 @@ def test_apply_static_args_to_empty_array_replaces_with_static_value(self):
result = apply_static_args(static_args, kwargs)
assert result == {"files": [{"id": "uuid-123"}]}

def test_apply_static_args_empty_array_does_not_skip_other_args(self):
"""Test empty array handling does not skip applying other static args."""
static_args = {
"$['files'][*]": {"id": "uuid-123"},
"meta.source": "static-source",
}
kwargs: dict[str, Any] = {
"files": [],
"meta": {"source": "dynamic"},
}

result = apply_static_args(static_args, kwargs)

assert result == {
"files": [{"id": "uuid-123"}],
"meta": {"source": "static-source"},
}

def test_apply_static_args_nested_property_in_array_element(self):
"""Test applying static args to nested property in array element - should replace property on every object."""
static_args = {"users[*].profile.verified": True}
Expand Down