feat(agent/tools): QuickForm escalation tool (escalationType=2)#876
Draft
cotovanu-cristian wants to merge 1 commit into
Draft
feat(agent/tools): QuickForm escalation tool (escalationType=2)#876cotovanu-cristian wants to merge 1 commit into
cotovanu-cristian wants to merge 1 commit into
Conversation
Introduces create_quick_form_escalation_tool, a langchain StructuredTool that materialises AgentQuickFormEscalationResourceConfig (escalationType=2) into a HITL task whose form is rendered from the channel's HitlSchema. The tool reads schema_id + schema from AgentEscalationChannel, calls TasksService.create_quickform_async (uipath-platform), suspends inside durable_interrupt on WaitEscalation, and on resume maps the channel's outcome_mapping to CONTINUE / END — matching the existing app-task escalation contract. Helpers (resolve_recipient_value, _parse_task_data, _resolve_escalation_action, EscalationAction) are reused from escalation_tool.py rather than extracting a shared seam; keeping QF and the existing escalation tool side-by-side mirrors how ixp_escalation_tool and escalation_memory live today. Wired into agent/tools/__init__.py (re-export) and tool_factory.py (dispatch on AgentQuickFormEscalationResourceConfig). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
d9afdce to
56cabe0
Compare
|
7 tasks
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 of Changes
Adds the QuickForm escalation tool (
escalationType=2) for low-code agents in a single new file, mirroring the existingescalation_tool.pyshape. The companion subpackage refactor that originally rode with this PR has been split out intorefactor/escalation-toolsso this PR stays minimal and easy to review.New tool (
src/uipath_langchain/agent/tools/quick_form_escalation_tool.py, +243)create_quick_form_escalation_tool(resource, agent=None)returning aStructuredTool.schema_id+schemafromAgentEscalationChannel(the model-side hoist fromquickFormPropertieskeeps Studio Web's emission shape compatible).resolve_recipient_valuereused from.escalation_tool— handles standard, asset, and argument-driven recipients.durable_interrupt, callsclient.tasks.create_quickform_async(title, task_schema_key, schema, data, …)fromuipath-platform, then suspends onWaitEscalationuntil the task completes._parse_task_dataand maps the outcome throughchannel.outcome_mappingtoCONTINUE/ENDvia_resolve_escalation_action— same contract as the app-task escalation tool.ValueErrorif a type-2 channel is missing eitherschemaIdorschema(Orchestrator requires both on every call).EscalationAction,_parse_task_data,_resolve_escalation_action,resolve_recipient_value) are imported from.escalation_tooldirectly — no shared "common" module is introduced. The two tools sit side-by-side, same wayescalation_memory.pyandixp_escalation_tool.pyalready do.Wiring
src/uipath_langchain/agent/tools/__init__.py(+2): re-exportscreate_quick_form_escalation_tool.src/uipath_langchain/agent/tools/tool_factory.py(+5): adds theAgentQuickFormEscalationResourceConfig→create_quick_form_escalation_toolbranch in_build_tool_for_resource.Branch totals: 3 files, +250 / -0.
Files Changed
src/uipath_langchain/agent/tools/quick_form_escalation_tool.py— +243 new file.src/uipath_langchain/agent/tools/__init__.py— +2 import +__all__entry.src/uipath_langchain/agent/tools/tool_factory.py— +5 import + dispatch branch.Test plan
python -c "from uipath_langchain.agent.tools import create_quick_form_escalation_tool"— import + re-export verified.python -c "from uipath_langchain.agent.tools.tool_factory import _build_tool_for_resource"— factory routing wired.git diff main HEAD --stat— 3 files, +250 confirmed.pytest tests/run.TasksService.create_quickform_async) to land first.Known limitations
create_quick_form_escalation_tooldirectly. Follow-up to add coverage analogous totests/agent/tools/test_escalation_tool.py.feat/escalation-quick-form) so theuipathrelease shipsTasksService.create_quickform_asyncandAgentQuickFormEscalationResourceConfig.refactor/escalation-tools. Ship this first; the refactor PR rebases the new tool into theescalation/subpackage on top.Are there any breaking changes?
🤖 Generated with Claude Code