Skip to content

fix(platform): report dependency 4xx on resume trigger creation as User errors [AE-1867] - #2044

Open
Chibionos wants to merge 3 commits into
mainfrom
fix/ae-1867-trigger-error-category
Open

Chibionos wants to merge 3 commits into
mainfrom
fix/ae-1867-trigger-error-category

Conversation

@Chibionos

@Chibionos Chibionos commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

When an agent tool starts a DeepRag, batch transform, job or IXP extraction and the dependency rejects the call, UiPathResumeTriggerCreator.create_trigger wraps the error as ErrorCategory.SYSTEM "Failed to create HITL action". So an ECS 400 saying the customer's index has no valid files looks like a platform failure of a HITL action. Eval telemetry then writes no ErrorCategory at all for UiPathFaultedTriggerError, and the URT eval alert pages the eval DRI for every one of them. Fixes AE-1867.

What breaks today: ECS tells the customer to fix their index, the SDK tells us the platform is down

issue

With the fix: the status code decides who owns the failure

fix

How it works

create_trigger now reads the HTTP status off the EnrichedException that the services raise. A 4xx becomes ErrorCategory.USER, except 401, 408, 409 and 429, which stay SYSTEM with every 5xx and non-HTTP error. A 401 is usually our job token expiring, and the other three are timeouts, conflicts and throttling. The message names the trigger type ("Failed to create resume trigger of type DeepRag") and the dependency's response stays in the detail. Errors that were already classified (index not found is DEPLOYMENT) pass through unchanged as before.

SaveExternalTrigger is our own Orchestrator call made inside the same try, so I wrap its failures as SYSTEM "Failed to register the resume trigger with Orchestrator" before the generic rule can see a 4xx from it. A 400 there is our bug, not the customer's index.

In uipath, _evals/_telemetry.py writes ErrorCategory for UiPathFaultedTriggerError too, and eval/runtime/runtime.py treats a User trigger error as a workload failure like any other User error, so IsRuntimeException is false and the console prints the error line instead of the logs panel. The alert side is UiPath/SRE#15356, which drops UiPathFaultedTriggerError rows whose category is User.

What to look at

  • I chose a status-code rule in the shared wrapper over per-service mappings. It covers the three signatures we saw this month (ECS createDeepRag 400, DU digitization 400, Orchestrator StartJobs 400) without touching each handler. The cost is that a 4xx from any trigger's dependency is now the caller's fault. I think that is right for 400/403/404, and I kept 401/408/409/429 out on purpose. Outside evals this also changes the category on the agent job itself, because uipath-runtime copies exc.category into the job error contract (UiPathRuntimeError.from_resume_trigger_error). A customer whose index is empty now sees a User fault on the job, which is what we want.
  • The message uses the same wording as fix(platform): name the failing trigger type in resume-trigger errors [MST-18258] #1993, so whichever lands second rebases trivially. fix(platform): name the failing trigger type in resume-trigger errors [MST-18258] #1993 keeps SYSTEM; this PR is the category change.
  • Version bumps: uipath-platform 0.3.24, uipath 2.15.16, and uipath now needs uipath-platform>=0.3.24 because both changed.

Testing

All of these are unit runs, with the HTTP failures injected at the service boundary (start_deep_rag_async, ProcessesService.invoke_async, ApiClient.request_async) as EnrichedException built with the production status, URL and body. I did not run an agent against a live tenant.

  • Repro first, as its own commit (c40e713b) on top of main 50a722a: 18 cases in test_hitl.py and 1 in test_eval_telemetry.py fail. They cover DeepRag 400/403/404 -> User, 408/409/429/500 -> System, StartJobs 400 -> User, SaveExternalTrigger 400 -> System, and EvalRun.Failed carrying ErrorCategory = "User". On the fix commits all of them pass, plus the 401 -> System case and two _is_user_facing_error cases I added after review (they failed before the review commit 84fc189f and pass on it).
  • Full suites on 84fc189f: uipath-platform 2917 passed, 8 skipped (credential-gated LLM tests), 4 e2e deselected; uipath 2931 passed. mypy, ruff check and ruff format --check are clean for both packages.
  • check_dependency_version_bumps.py and check_version_uniqueness.py pass locally, and uv lock --check passes; the lockfiles change only the two version lines.

Before: every case fails on category, message, or the missing telemetry property

before

After: same named cases on 84fc189f, plus the 401 case

after

Impact and the proof-of-work gate

Over 30 days to 2026-12-03 in prd: one paid aue org (58a6e1c3) had 43 failed eval runs from this path, and they were all 13 aue alert windows of agents-evalrun-failed-urt. One paid eus org hit the same wrapper twice on a DU 400. Full write up, queries and the customer mitigation are on AE-1867.

The independent Codex intent gate in our proof-of-work flow did not pass. It returned REVISE three times, and I went ahead after the third with the eval DRI lead's OK. None of the objections were against the fix itself; they were about how the scope and the evidence were stated. Each one and what I did:

First verdict

Second verdict

  • Document the batch transform DEPLOYMENT mapping and the pass-through of classified errors, and fix a line citation. Done in the intent.
  • Exercise 408 and the SaveExternalTrigger path. I added both, and that is why the registration call is now explicitly SYSTEM.
  • Pin pytest verbosity in the capture. The capture script runs -vv --tb=short.

Third verdict

  • Name the Inbox connection lookup in the scope. A 4xx from connections.list_async is now User; a missing connection stays System.
  • The mocked requests should match their endpoints, or the claim should be narrowed. The methods and URLs match the real calls, and I narrowed the claim: failures are injected at the service boundary, no transport is exercised.
  • Capture full assertion diffs, and check the response detail independently. The capture no longer truncates. The detail is asserted on the fix commit ("No valid files..." in error.detail); on main that line is never reached behind the tuple assertion, and the production rows show the ECS text in the message today.

The work gate (Codex, asked to refute the diff against the evidence) also did not pass; it returned REFUTED twice. The first round found two real problems, which I fixed: uv lock had reset the exclude-newer options in packages/uipath/uv.lock (reverted to main's block), and the intent still named the old registration message. It also flagged that I had moved _determine_trigger_type out of the try; in the second round I put it back, with a None default and a fallback message in the same shape as #1993, so the wrapper catches exactly what it catches on main. The objection left standing is build identity: the gate wants the browser markers our MFE flow uses (federation container and dev globals), which do not exist for an SDK change. Identity here is the commit SHA printed at the top of each capture and the branch-only test ids.

Deep review: slop meter 5/100, tunnel vision 0/100. The Codex recheck came back "amend" with two P2s, both fixed in 84fc189f: a 401 was being classified as User (it is our token, so it stays System now), and User trigger errors were still counted as runtime exceptions in eval telemetry.

Out of scope

  • The 409 on GET ecs_/v2/deeprag/<id> (5 rows) escapes from the resume read as a raw EnrichedException. It is an ECS concurrency error and stays System; the read path is a separate change.

🤖 Generated with Claude Code

Chibionos and others added 2 commits December 3, 2026 21:47
…User errors [AE-1867]

create_trigger wrapped every non-HITL failure as ErrorCategory.SYSTEM
"Failed to create HITL action". A 4xx from the dependency (other than
408, 409, 429) is now a User error and the message names the trigger type.
SaveExternalTrigger failures stay System. Eval telemetry writes
ErrorCategory for UiPathFaultedTriggerError so the URT alert can filter it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Chibionos
Chibionos requested review from AAgnihotry and a lite review from Copilot December 4, 2026 05:57
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Dec 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are identified, and targeted regression and telemetry coverage addresses the changed error-classification and reporting paths.

No open issues 🎉

What changed in this PR

Updates resume-trigger error classification so dependency 4xx responses are reported as user errors while Orchestrator registration failures remain system errors. Eval telemetry now records categories for faulted trigger errors.

Changes:

  • Added status-based trigger classification and explicit registration error handling.
  • Added telemetry and regression tests.
  • Updated package versions, dependency constraints, and lockfiles.
File Description
packages/​uipath/​uv.lock Updates locked uipath and platform dependency versions.
packages/​uipath/​tests/​cli/​eval/​test_eval_telemetry.py Tests ErrorCategory telemetry for faulted trigger errors.
packages/​uipath/​src/​uipath/​_cli/​_evals/​_telemetry.py Records error categories for UiPathFaultedTriggerError telemetry.
packages/​uipath/​pyproject.toml Updates the package version and platform dependency floor.
packages/​uipath-platform/​uv.lock Updates the locked platform package version.
packages/​uipath-platform/​tests/​services/​test_hitl.py Tests status-based trigger classification and registration failure handling.
packages/​uipath-platform/​src/​uipath/​platform/​resume_triggers/​_protocol.py Classifies dependency failures by HTTP status and wraps Orchestrator registration failures.
packages/​uipath-platform/​pyproject.toml Bumps the platform package version.

Review effort: Lite

…er-facing in evals [AE-1867]

A 401 on a dependency call is usually an expired job token, so it stays
System. Eval runs now mark a User-category UiPathFaultedTriggerError as a
workload failure, so IsRuntimeException is false for it, like other User errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sonarqubecloud

sonarqubecloud Bot commented Dec 4, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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 test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants