Skip to content

feat: HitlSchema types and dynamic QuickForm dispatch for guardrail escalations#1737

Draft
dushyant-uipath wants to merge 1 commit into
mainfrom
feat/guardrail-dynamic-hitl-schema
Draft

feat: HitlSchema types and dynamic QuickForm dispatch for guardrail escalations#1737
dushyant-uipath wants to merge 1 commit into
mainfrom
feat/guardrail-dynamic-hitl-schema

Conversation

@dushyant-uipath

Copy link
Copy Markdown
Contributor

Summary

  • Adds uipath-platform/hitl/ module with HitlSchema, HitlSchemaField, HitlSchemaOutcome, HitlFieldType, HitlFieldDirection — Python mirror of @uipath/hitl-schema-types
  • Adds pydantic_to_hitl_schema(): converts Pydantic models to HitlSchema; field aliases become schema field IDs
  • Adds hitl_schema: HitlSchema | None field to CreateTask / CreateEscalation
  • _handle_task_trigger dispatches to create_quickform_async when hitl_schema is set — no pre-deployed Action App required
  • Deterministic taskSchemaKey derived from SHA-256 of schema content (Orchestrator upserts, no duplicates)

Context

Part of the dynamic schemas feature for agent guardrail escalations. Instead of requiring a developer to pre-deploy a static Action App with fixed form fields, the schema is generated at runtime by the LLM and travels inline with the escalation interrupt.

This PR is the platform foundation. The LangChain runtime PR (uipath-langchain-python) depends on this being published first.

See design doc: https://uipath.atlassian.net/wiki/spaces/BPA/pages/90813301792/Dynamic+Schemas+for+Agent+Guardrail+Escalations

Test plan

  • uv run pytest packages/uipath-platform/tests/services/test_hitl_schema.py — 20 new unit tests
  • Full platform suite: uv run pytest packages/uipath-platform/tests/

🤖 Generated with Claude Code

…tasks

Adds a new `hitl/` module to `uipath-platform` with `HitlSchema`,
`HitlSchemaField`, `HitlSchemaOutcome`, `HitlFieldType`, and
`HitlFieldDirection` — a Python mirror of `@uipath/hitl-schema-types`.

`pydantic_to_hitl_schema()` converts Pydantic models into `HitlSchema`
instances. Field aliases become the schema field IDs, enabling PascalCase
form field names while keeping Python field names snake_case.

`CreateTask` gains an optional `hitl_schema` field. When set,
`_handle_task_trigger` routes to `create_quickform_async` instead of
`create_async`, sending the schema inline to `GenericTasks/CreateTask`
(type=6). A deterministic UUID derived from the schema content is used
as `taskSchemaKey` so Orchestrator can upsert rather than duplicate.

No pre-deployed Action App is required when a schema is provided.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
85.6% 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

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant