feat(agent/tools): QuickForm escalation tool#876
Draft
cotovanu-cristian wants to merge 7 commits into
Draft
Conversation
d9afdce to
56cabe0
Compare
7 tasks
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>
56cabe0 to
2b82871
Compare
…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>
2b82871 to
2cf2c9e
Compare
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>
…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>
|
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 support for QuickForm escalation channels (
type: actionCenterQuickForm) to the low-code agent escalation tool. The QuickForm path is integrated into the existingcreate_escalation_toolvia 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_toolnow takeschannel: EscalationChanneland handles both variants.create_task_for_channel(client, channel, *, title, data, recipient, folder_path) -> Taskconcentrates 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_taskcollapses to a single call to it.app_nameis derived only forAgentEscalationChannel(QuickForm →None); the tool'sdisplay_namemetadata falls back tochannel.namewhen there is no app name.channel.properties.form_schema(the field;"schema"is its serialization alias) and the id from theschema_idproperty. RaisesAgentRuntimeError(TERMINATION_ESCALATION_ERROR)if a QuickForm channel resolves noschema_id.ixp_escalation_tool.py(+9/-2) —display_namemetadata guarded byisinstance(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 version0.11.13→0.11.14.Files Changed
src/uipath_langchain/agent/tools/escalation_tool.py— QuickForm channel integration +create_task_for_channeldispatch.src/uipath_langchain/agent/tools/ixp_escalation_tool.py—display_namechannel-type guard.src/uipath_langchain/agent/tools/escalation_memory.py— formatting only.tests/agent/tools/test_escalation_tool.py(+261) —TestQuickFormEscalation(dispatch tocreate_quickform_async,app_name=NoneinWaitEscalation, 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 existingAgentEscalationResourceConfigbranch — no new factory branch).pyproject.toml/uv.lock— version bump.Totals: 7 files, +393 / -19.
Test plan
ruff format --check+ruff checkonescalation_tool.py— pass.pytest tests/— cannot collect locally; the installed/lockeduipath 2.10.74lacksAgentQuickFormChannelProperties(ImportError on collection). Blocked untiluv.lockresolves to theuipathrelease that ships theEscalationChannelunion +TasksService.create_quickform_async.mypy— same import blocker.Known limitations
uipathrelease: needsAgentEscalationChannel/AgentQuickFormEscalationChannel/AgentQuickFormChannelPropertiesandTasksService.create_quickform_async. The pinuipath>=2.10.74,<2.11.0must resolve to that version anduv.lockbe updated before the suite can run.schema_idis validated at runtime (insidecreate_task_for_channel), not at tool construction. Follow-up: move to a construction-timeAgentStartupError(INVALID_TOOL_CONFIG)via avalidate_escalation_channelseam (matchingcontext_tool.py/integration_tool.py) — designed, not yet implemented.Are there any breaking changes?
🤖 Generated with Claude Code