Skip to content

feat(agent/tools): QuickForm escalation tool (escalationType=2)#876

Draft
cotovanu-cristian wants to merge 1 commit into
mainfrom
feat/quick-form-escalation-tool
Draft

feat(agent/tools): QuickForm escalation tool (escalationType=2)#876
cotovanu-cristian wants to merge 1 commit into
mainfrom
feat/quick-form-escalation-tool

Conversation

@cotovanu-cristian
Copy link
Copy Markdown
Collaborator

@cotovanu-cristian cotovanu-cristian commented May 27, 2026

Summary of Changes

Adds the QuickForm escalation tool (escalationType=2) for low-code agents in a single new file, mirroring the existing escalation_tool.py shape. The companion subpackage refactor that originally rode with this PR has been split out into refactor/escalation-tools so 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 a StructuredTool.
    • Reads schema_id + schema from AgentEscalationChannel (the model-side hoist from quickFormProperties keeps Studio Web's emission shape compatible).
    • Resolves the recipient via resolve_recipient_value reused from .escalation_tool — handles standard, asset, and argument-driven recipients.
    • Inside a durable_interrupt, calls client.tasks.create_quickform_async(title, task_schema_key, schema, data, …) from uipath-platform, then suspends on WaitEscalation until the task completes.
    • After resume, filters the response with _parse_task_data and maps the outcome through channel.outcome_mapping to CONTINUE / END via _resolve_escalation_action — same contract as the app-task escalation tool.
    • Fail-fast ValueError if a type-2 channel is missing either schemaId or schema (Orchestrator requires both on every call).
    • Helpers (EscalationAction, _parse_task_data, _resolve_escalation_action, resolve_recipient_value) are imported from .escalation_tool directly — no shared "common" module is introduced. The two tools sit side-by-side, same way escalation_memory.py and ixp_escalation_tool.py already do.
  • Wiring

    • src/uipath_langchain/agent/tools/__init__.py (+2): re-exports create_quick_form_escalation_tool.
    • src/uipath_langchain/agent/tools/tool_factory.py (+5): adds the AgentQuickFormEscalationResourceConfigcreate_quick_form_escalation_tool branch 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.
  • Not verified: full pytest tests/ run.
  • Not verified: end-to-end QuickForm task creation against a live Orchestrator — requires the matching uipath-python PR (which adds TasksService.create_quickform_async) to land first.

Known limitations

  • No new tests cover create_quick_form_escalation_tool directly. Follow-up to add coverage analogous to tests/agent/tools/test_escalation_tool.py.
  • Gated on the matching uipath-python PR (feat/escalation-quick-form) so the uipath release ships TasksService.create_quickform_async and AgentQuickFormEscalationResourceConfig.
  • The shared-seam refactor that originally sat on top of this PR has been moved to refactor/escalation-tools. Ship this first; the refactor PR rebases the new tool into the escalation/ subpackage on top.

Are there any breaking changes?

  • None — additive: a new tool factory, a new public export, no removals or renames.

🤖 Generated with Claude Code

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>
@cotovanu-cristian cotovanu-cristian force-pushed the feat/quick-form-escalation-tool branch from d9afdce to 56cabe0 Compare May 27, 2026 16:50
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)
25.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@cotovanu-cristian cotovanu-cristian changed the title feat(agent): QuickForm escalation tool + escalation subpackage refactor feat(agent/tools): QuickForm escalation tool (escalationType=2) May 27, 2026
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.

1 participant