fix: handle invalid integration tool inputs#1003
Conversation
6911e76 to
b51d933
Compare
There was a problem hiding this comment.
Pull request overview
Improves robustness of Integration Service tool handling in uipath-langchain by (1) mapping a specific Integration Service validation failure into a structured user error, and (2) failing fast on invalid generated tool configuration (empty toolPath) to avoid hitting incorrect endpoints in production.
Changes:
- Map Integration Service
422responses with semantic error codeINVALID_DATAtoAgentRuntimeErrorwithUiPathErrorCategory.USER(while keeping provider details in the message). - Reject Integration Service tools with empty/whitespace
tool_pathduring tool construction (beforeUiPath()SDK instantiation). - Bump package version and lockfile entries (currently to
0.14.16).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/uipath_langchain/agent/tools/integration_tool.py |
Adds a specific (422, "INVALID_DATA") error mapping and validates tool_path before constructing the SDK/tool. |
tests/agent/tools/test_integration_tool.py |
Adds coverage for empty toolPath validation and the new 422 INVALID_DATA mapping behavior. |
pyproject.toml |
Updates project version to 0.14.16. |
uv.lock |
Updates locked uipath-langchain package version to 0.14.16. |
| assert exc_info.value.error_info.code == AgentRuntimeError.full_code( | ||
| AgentRuntimeErrorCode.HTTP_ERROR | ||
| ) | ||
| assert exc_info.value.error_info.status == 422 |
There was a problem hiding this comment.
No, I explicitly removed the category assertion. The fact that we are explicitly catching is a lot more important than the specific category. The category might be subject to change.
|



Summary
Why
Two production failures were falling through as Unknown errors. Connector field validation was not mapped by its semantic error code, and generated tools with an empty activity path reached the Integration Service base endpoint and failed with HTTP 405.
The 422 mapping is intentionally limited to INVALID_DATA; unrelated 422 responses continue to propagate unchanged.