feat: resolve ArgumentEmail and ArgumentGroupName recipients at runtime#735
Open
dushyant-uipath wants to merge 1 commit intomainfrom
Open
feat: resolve ArgumentEmail and ArgumentGroupName recipients at runtime#735dushyant-uipath wants to merge 1 commit intomainfrom
dushyant-uipath wants to merge 1 commit intomainfrom
Conversation
86653ab to
7ae74eb
Compare
Contributor
|
Please also add new tests to cover the new runtime code paths. |
a167914 to
9a6fb38
Compare
Updates resolve_recipient_value() in escalation_tool to handle the two new argument-driven recipient types. Each type carries an argument_name that is looked up in the tool's runtime kwargs to produce a concrete email or group-name TaskRecipient. Follows the same pattern as AssetRecipient resolution. Backward compatible -- input_args defaults to None. Depends on uipath-python adding ArgumentEmailRecipient and ArgumentGroupNameRecipient to uipath.agent.models.agent. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9a6fb38 to
a62988e
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
Updates
resolve_recipient_value()inescalation_tool.pyto handle the two new argument-driven recipient types added in UiPath/uipath-python PR #1521. At runtime, each type'sargument_pathis looked up in the agent's input kwargs using dot-notation (safe_get_nested) to produce a concreteTaskRecipient.Also fixes
create_mcp_tools_from_agent— the function was incorrectly aliased tocreate_mcp_tools_and_clients(which takeslist[AgentMcpResourceConfig]), but callers pass aLowCodeAgentDefinition. Replaced with a proper wrapper that extracts MCP resources from the agent definition first.Changed files
escalation_tool.pyresolve_recipient_valueaccepts optionalinput_args;ArgumentEmailRecipientandArgumentGroupNameRecipienthandling added; call site passestool.metadata["agent_input"]mcp/__init__.pycreate_mcp_tools_from_agentreplaced with a proper wrapper (was a broken alias); extractsAgentMcpResourceConfigresources from agent definition before delegatingpyproject.tomluipath>=2.10.44(requires the companion PR),uipath-platform>=0.1.24Failure modes & what was tested
The only runtime failure path
In
resolve_recipient_value():This raises when:
This is intentional — a misconfigured escalation should fail loudly at task creation time, not silently create a task with no assignee.
There is no feature flag in the Python layer. The flag (
EnableEscalationArgumentAssignee) lives in the frontend only. If the frontend sends anArgumentEmail/ArgumentGroupNamerecipient (flag is on), the Python side always processes it. The frontend strips these types from the payload when the flag is off, so the Python code never sees them in that case.What was tested
ArgumentEmailrecipient, input argassigneeEmail="test@example.com"→ Action Center task created with correct assignee ✓ValueErrorraised with clear message identifying the missing arg ✓create_mcp_tools_from_agentfixed: was crashing with'tuple' object has no attribute 'is_enabled'because iterating a Pydantic model yields(field_name, value)tuples, not resource objects — now correctly filtersisinstance(r, AgentMcpResourceConfig)✓AssetRecipientandStandardRecipientresolution paths unaffected ✓input_args=Nonedefault: all existing callers that don't passinput_argscontinue to work ✓Related
Test plan
ArgumentEmailrecipient,argument_path="assigneeEmail", run with that input populated — verify Action Center task has correct assigneeArgumentGroupNameValueErrorwith clear messageAssetRecipientandStandardRecipientpaths unaffectedcreate_mcp_tools_from_agentno longer crashes when agent has MCP resources