Skip to content

fix: handle invalid integration tool inputs#1003

Merged
andreitava-uip merged 4 commits into
mainfrom
fix/integration-error-categorization
Jul 23, 2026
Merged

fix: handle invalid integration tool inputs#1003
andreitava-uip merged 4 commits into
mainfrom
fix/integration-error-categorization

Conversation

@andreitava-uip

@andreitava-uip andreitava-uip commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • categorize Integration Service 422 INVALID_DATA responses as User errors while preserving provider details
  • reject generated integration tools with empty toolPath values before SDK construction
  • bump uipath-langchain from 0.14.15 to 0.14.16

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.

@andreitava-uip
andreitava-uip force-pushed the fix/integration-error-categorization branch from 6911e76 to b51d933 Compare July 23, 2026 14:28
@andreitava-uip
andreitava-uip marked this pull request as ready for review July 23, 2026 14:32
Copilot AI review requested due to automatic review settings July 23, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 422 responses with semantic error code INVALID_DATA to AgentRuntimeError with UiPathErrorCategory.USER (while keeping provider details in the message).
  • Reject Integration Service tools with empty/whitespace tool_path during tool construction (before UiPath() 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.

Comment thread pyproject.toml
Comment thread src/uipath_langchain/agent/tools/integration_tool.py
Comment on lines +1072 to +1075
assert exc_info.value.error_info.code == AgentRuntimeError.full_code(
AgentRuntimeErrorCode.HTTP_ERROR
)
assert exc_info.value.error_info.status == 422

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqubecloud

Copy link
Copy Markdown

@andreitava-uip
andreitava-uip merged commit 1be8f5f into main Jul 23, 2026
45 checks passed
@andreitava-uip
andreitava-uip deleted the fix/integration-error-categorization branch July 23, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants