Skip to content

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

Draft
cotovanu-cristian wants to merge 7 commits into
mainfrom
feat/quick-form-escalation-tool
Draft

feat(agent/tools): QuickForm escalation tool#876
cotovanu-cristian wants to merge 7 commits into
mainfrom
feat/quick-form-escalation-tool

Conversation

@cotovanu-cristian

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

Copy link
Copy Markdown
Collaborator

Summary of Changes

Adds support for QuickForm escalation channels (type: actionCenterQuickForm) to the low-code agent escalation tool. The QuickForm path is integrated into the existing create_escalation_tool via the upstream discriminated-union channel model (EscalationChannel = AgentEscalationChannel | AgentQuickFormEscalationChannel) — not a separate tool or factory branch. A QuickForm channel renders a schema-first FormLib task inline (no deployed Action Center app); Action Center channels keep dispatching to their app task.

  • escalation_tool.py (+62/-11)
    • create_escalation_tool now takes channel: EscalationChannel and handles both variants.
    • New module-level create_task_for_channel(client, channel, *, title, data, recipient, folder_path) -> Task concentrates the per-channel dispatch: QuickForm → client.tasks.create_quickform_async(task_schema_key=schema_id, schema=form_schema, …); Action Center → client.tasks.create_async(app_name=…, …). create_escalation_task collapses to a single call to it.
    • app_name is derived only for AgentEscalationChannel (QuickForm → None); the tool's display_name metadata falls back to channel.name when there is no app name.
    • Reads the form body from channel.properties.form_schema (the field; "schema" is its serialization alias) and the id from the schema_id property. Raises AgentRuntimeError(TERMINATION_ESCALATION_ERROR) if a QuickForm channel resolves no schema_id.
  • ixp_escalation_tool.py (+9/-2)display_name metadata guarded by isinstance(channel, AgentEscalationChannel) (QuickForm/other → None), tracking the same concrete-class model restructure.
  • escalation_memory.py (+9/-3) — import/signature line-wrapping only; no behavior change.
  • pyproject.toml / uv.lock (+1/-1 each) — package version 0.11.130.11.14.

Files Changed

  • src/uipath_langchain/agent/tools/escalation_tool.py — QuickForm channel integration + create_task_for_channel dispatch.
  • src/uipath_langchain/agent/tools/ixp_escalation_tool.pydisplay_name channel-type guard.
  • src/uipath_langchain/agent/tools/escalation_memory.py — formatting only.
  • tests/agent/tools/test_escalation_tool.py (+261) — TestQuickFormEscalation (dispatch to create_quickform_async, app_name=None in WaitEscalation, outcome-mapping END, tool metadata, action-center-does-not-dispatch-to-quickform) + test_escalation_tool_metadata_display_name_falls_back_to_channel_name.
  • tests/agent/tools/test_tool_factory.py (+50) — test_quick_form_resource_routes_through_escalation_tool_path (QuickForm routes through the existing AgentEscalationResourceConfig branch — no new factory branch).
  • pyproject.toml / uv.lock — version bump.

Totals: 7 files, +393 / -19.

Test plan

  • ruff format --check + ruff check on escalation_tool.py — pass.
  • Not verified: pytest tests/ — cannot collect locally; the installed/locked uipath 2.10.74 lacks AgentQuickFormChannelProperties (ImportError on collection). Blocked until uv.lock resolves to the uipath release that ships the EscalationChannel union + TasksService.create_quickform_async.
  • Not verified: mypy — same import blocker.
  • Not verified: end-to-end QuickForm task creation against a live Orchestrator.

Known limitations

  • Gated on the matching uipath release: needs AgentEscalationChannel / AgentQuickFormEscalationChannel / AgentQuickFormChannelProperties and TasksService.create_quickform_async. The pin uipath>=2.10.74,<2.11.0 must resolve to that version and uv.lock be updated before the suite can run.
  • QuickForm schema_id is validated at runtime (inside create_task_for_channel), not at tool construction. Follow-up: move to a construction-time AgentStartupError(INVALID_TOOL_CONFIG) via a validate_escalation_channel seam (matching context_tool.py / integration_tool.py) — designed, not yet implemented.

Are there any breaking changes?

  • None — additive. QuickForm is a new channel variant; existing Action Center escalation behavior is unchanged.

🤖 Generated with Claude Code

@cotovanu-cristian cotovanu-cristian force-pushed the feat/quick-form-escalation-tool branch from d9afdce to 56cabe0 Compare May 27, 2026 16:50
@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
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 56cabe0 to 2b82871 Compare June 8, 2026 14:20
…fallback

Fold the standalone QuickForm escalation tool into escalation_tool, and
default the tool's display_name metadata to the channel name when the
channel has no app_name (QuickForm). A None display_name previously broke
automation-tracker OperationPayload validation downstream. Adds a test
covering the QuickForm fallback.

Bumps uipath-langchain to 0.11.14.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cotovanu-cristian cotovanu-cristian force-pushed the feat/quick-form-escalation-tool branch from 2b82871 to 2cf2c9e Compare June 8, 2026 15:22
cotovanu-cristian and others added 3 commits June 8, 2026 19:26
The quick-form channel property was renamed from `schema` to `form_schema`
(alias "schema") in uipath-python to avoid shadowing BaseModel.schema().
Update the escalation tool and tests to read `channel.properties.form_schema`
and construct the properties with the field name.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
uipath-python restored AgentEscalationChannel as the concrete Action Center
channel and introduced EscalationChannel as the discriminated union. Annotate
the selected channel as EscalationChannel and narrow with AgentEscalationChannel
for the Action Center app_name; update fixtures to construct the concrete class.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two new tests in TestQuickFormEscalation:
- a quick-form channel whose schema carries no schemaId raises
  AgentRuntimeError before create_quickform_async is invoked;
- an actionCenter channel dispatches to create_async and never to
  create_quickform_async, pinning discriminator-based routing between the
  actionCenter and actionCenterQuickForm channel values.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cotovanu-cristian cotovanu-cristian changed the title feat(agent/tools): QuickForm escalation tool (escalationType=2) feat(agent/tools): QuickForm escalation tool Jun 8, 2026
cotovanu-cristian and others added 2 commits June 8, 2026 23:27
…calation_tool

Consolidate the per-channel task dispatch (Action Center vs QuickForm) into a single create_task_for_channel function; create_escalation_task collapses to one call.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Trim create_escalation_tool and create_task_for_channel docstrings to consumer-focused summaries; drop method paths and dispatch internals.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 90%)

See analysis details on SonarQube Cloud

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