fix(eval): serialize non-json-native tool args when simulating - #1832
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes simulation-time failures when tool-call arguments include non-JSON-native Python objects by routing serialization through shared helpers in uipath.core.serialization, and adds regression tests to cover the simulation paths.
Changes:
- Use
serialize_defaultsas thejson.dumps(..., default=...)handler when building theLLMMockerprompt. - Normalize the simulate-component request payload before passing it to httpx’s
json=encoding. - Add tests covering UUID and other non-JSON-native tool args, and bump package version to
2.13.17.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/uipath/src/uipath/eval/mocks/_llm_mocker.py | Uses serialize_defaults to ensure prompt JSON encoding doesn’t fail on validated Python objects (UUID/datetime/Enum/etc.). |
| packages/uipath/src/uipath/eval/mocks/_simulate_component_service.py | Normalizes simulate-component payload prior to httpx JSON encoding (but see review comments re: serialize_object coverage). |
| packages/uipath/tests/cli/eval/mocks/test_mocker_arg_serialization.py | Adds regression tests for tool-arg serialization across both simulation paths. |
| packages/uipath/pyproject.toml | Bumps package version to 2.13.17. |
| packages/uipath/uv.lock | Updates lockfile entry for the uipath package version bump. |
Comments suppressed due to low confidence (1)
packages/uipath/src/uipath/eval/mocks/_simulate_component_service.py:32
- Even after calling
serialize_object(payload),set/Enumvalues can remain non-serializable. Passing a JSON-native object to httpx is safest by converting withserialize_json()and parsing back to a dict/list tree.
json=serialize_object(payload),
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
radu-mocanu
force-pushed
the
fix/mocker-uuid-serialization
branch
from
July 28, 2026 13:43
4263ab5 to
dfc82e1
Compare
andreitava-uip
approved these changes
Jul 28, 2026
radu-mocanu
force-pushed
the
fix/mocker-uuid-serialization
branch
from
July 28, 2026 13:58
dfc82e1 to
66b42fe
Compare
radu-mocanu
force-pushed
the
fix/mocker-uuid-serialization
branch
from
July 28, 2026 13:59
66b42fe to
600f190
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
uuid.UUID,datetime,Enum, set)Why
tool
args_schemamodels can type a field as any python type, and langchain hands the tool the validated value, so the mocker receives real objects rather than the strings the model emitted. both paths encoded that with a barejson.dumps, which raisedTypeError: Object of type UUID is not JSON serializableand surfaced verbatim as the tool's output. the IXP extraction tool types its attachment id asuuid.UUID, so every simulated call to it failed before the simulating LLM was even reached.serialization now goes through the existing helpers in
uipath.core.serialization, so payloads that already encoded cleanly are unchanged.