Skip to content

PC-5145: include DeepRag failure_reason in the resume fault message - #1966

Draft
al3xanndru wants to merge 1 commit into
mainfrom
wabbit-dri/PC-5145_2
Draft

al3xanndru wants to merge 1 commit into
mainfrom
wabbit-dri/PC-5145_2

Conversation

@al3xanndru

@al3xanndru al3xanndru commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Problem

PC-5145: when a DeepRag task fails, the resumed agent job faults with only DeepRag '<name>' did not finish successfully. The agent and the tool span get no reason. In SRE-674993 (prd Japan East) the tenant's AI Trust Layer policy blocked ECS's gemini-2.5-flash. Six DeepRag tasks failed, and the customer could not see that their own governance policy was the cause. SRE-669204, SRE-671555 and SRE-673408 hit the same opaque message.

Root cause

UiPathResumeTriggerReader.read_trigger, DEEP_RAG branch (packages/uipath-platform/src/uipath/platform/resume_triggers/_protocol.py), raises a fixed message for any non-Successful status. It never reads DeepRagResponse.failure_reason (alias failureReason), which the model already parses from the ECS GET response. uipath-runtime builds the job error from exc.message (UiPathRuntimeError.from_resume_trigger_error), so the reason has to be in the message, not in detail.

Change

  • When failure_reason is non-empty, the message becomes DeepRag '<name>' did not finish successfully. Reason: <failure_reason>. When it is empty, the message is unchanged.
  • The category stays ErrorCategory.USER. See the open questions.
  • uipath-platform goes from 0.2.41 to 0.2.42, and both lockfiles are updated, as this repo does for fixes.

Tests

  • test_read_deep_rag_trigger_failed now also asserts the full message, including the reason.
  • New test_read_deep_rag_trigger_failed_without_reason: with no failure_reason, the message stays as before and has no trailing Reason:.
  • Results in packages/uipath-platform:
    • pytest tests/services/test_hitl.py: 144 passed.
    • ruff check .: clean.
    • ruff format --check .: clean.
    • mypy on the changed files: clean.

Risks / open questions

  • Category. The ticket asks to derive the category from the failure instead of hard-coding USER. The DeepRag API response has only the free-text failureReason; ECS's internal UserError flag is not exposed. Parsing free text for a category would be brittle. Moving everything to SYSTEM would page Agents for customer-side failures (governance policy, oversized documents). So USER is kept. A real fix needs ECS (Context Grounding) to return a structured user/system flag or error code on the DeepRag GET. Once it does, map that flag here.
  • The reason may be empty. SRE-674993 could not confirm whether ECS fills failureReason for the governance-403 case. This change only surfaces what ECS returns. For that failure to become visible, ECS also has to write the LLM Gateway message to failureReason; that is tracked as the external action in the triage.
  • Raw ECS text. failureReason is passed through verbatim into a user-visible error. It is ECS's customer-facing field, so this is expected.
  • To reach agents, a uipath-platform release has to be picked up by uipath-agents-python / uipath-langchain.

🤖 Generated with Claude Code


Drafted by the wabbit-dri draft-fixes loop for PC-5145 (draft #2), for a human to review: not ready to merge as is.

🤖 Generated with Claude Code

@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Oct 30, 2026
@sonarqubecloud

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant