feat: categorize a few common errors#895
Open
andreiancuta-uipath wants to merge 9 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ument Rename SchemaModificationError to SchemaNavigationError (navigation failures are skipped by the caller). A non-dict value for an object-typed schema field is a distinct, fatal misconfiguration: raise the new InvalidStaticArgError instead of a bare AssertionError, and catch it in StaticArgsHandler to surface a categorized AgentRuntimeError (INVALID_STATIC_ARGUMENT, USER) instead of leaking to UNEXPECTED_ERROR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9c1e01e to
0374416
Compare
Drop the bespoke _Attachment stub and the duplicate top-level attachment tests; consolidate the invalid-UUID and missing-attachment (404) cases into TestResolveJobAttachmentArguments using the existing MockAttachment model and the mock_uipath_client fixture. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0374416 to
1278d41
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves runtime error observability by introducing new AgentRuntimeErrorCodes and mapping several previously “unexpected” exceptions into structured, correctly categorized AgentRuntimeErrors at the appropriate layers.
Changes:
- Add new runtime error codes and raise typed
AgentRuntimeErrors for common high-volume failure modes (context grounding, invalid attachments/static args, output validation). - Split schema-related failures into “navigation” (skippable) vs “invalid static arg value” (fatal) errors and update static-args handling accordingly.
- Bump package version to
0.11.14and update lockfile.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Updates lock metadata and bumps package version entry. |
| pyproject.toml | Bumps package version to 0.11.14. |
| src/uipath_langchain/agent/exceptions/exceptions.py | Adds new AgentRuntimeErrorCode values for newly categorized errors. |
| src/uipath_langchain/agent/tools/static_args.py | Treats invalid object-typed static-arg values as fatal and raises categorized AgentRuntimeError. |
| src/uipath_langchain/agent/tools/schema_editing.py | Introduces SchemaNavigationError vs InvalidStaticArgError and enforces dict-only object static values. |
| src/uipath_langchain/agent/tools/internal_tools/analyze_files_tool.py | Validates attachment IDs as UUIDs and categorizes missing Orchestrator attachments via raise_for_enriched. |
| src/uipath_langchain/agent/tools/context_tool.py | Categorizes context grounding “index not found” and “ingestion in progress” exceptions. |
| src/uipath_langchain/agent/react/terminate_node.py | Converts output schema validation failures into a typed user error (OUTPUT_VALIDATION_ERROR). |
| tests/agent/tools/test_static_args.py | Adds coverage for fatal invalid static arg value behavior and correct categorization. |
| tests/agent/tools/test_schema_editing.py | Updates tests for renamed schema error and adds coverage for invalid object static values. |
| tests/agent/tools/test_context_tool.py | Adds coverage for newly categorized context grounding exceptions. |
| tests/agent/tools/internal_tools/test_analyze_files_tool.py | Updates invalid UUID expectation and adds missing attachment (404) categorized error coverage. |
| tests/agent/react/test_terminate_node.py | Adds coverage for termination output schema mismatch categorization. |
1278d41 to
54a192d
Compare
|
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.



Moves several high-volume causes out of the
AGENT_RUNTIME.UNEXPECTED_ERRORcatch-all bucket by catching them at the right layer and raising structured, correctly-categorizedAgentRuntimeErrors.Errors categorized
CONTEXT_GROUNDING_INGESTION_IN_PROGRESS, USER) — querying an index before ingestion finishes.INVALID_ATTACHMENT_ID, SYSTEM) — the Analyze Files tool now validates the attachment id is a UUID instead of raising a bareValueError.HTTP_ERRORviaraise_for_enriched) — a deleted/not-found job attachment is surfaced as a clear error.OUTPUT_VALIDATION_ERROR, USER) — model output that fails the configured output schema at termination.INVALID_STATIC_ARGUMENT, USER) — a non-dict value for an object-typed static-arg field is now a fatal, categorized error. Also renamesSchemaModificationError→SchemaNavigationErrorto distinguish skippable navigation failures from this fatal misconfiguration.Last commit bumps the package version to
0.11.14.