Repository navigation
fix(agent): don't crash the error mapper on LLM Gateway raw vendor error details - #1137
Open
ionut-mihalache-uipath wants to merge 1 commit into
Open
ionut-mihalache-uipath wants to merge 1 commit into
ionut-mihalache-uipath wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The generic mapper now exposes potentially sensitive raw vendor messages to users.
1 open finding
What changed in this PR
Improves LLM Gateway error handling and Jev unknown-model classification.
Changes:
- Handles object-shaped gateway error details.
- Recognizes Gateway unsupported-model responses.
- Updates package versions, dependencies, lockfile, and tests.
| File | Description |
|---|---|
src/uipath_langchain/agent/exceptions/llm.py |
Extracts messages from object details. |
src/uipath_langchain/agent/tools/internal_tools/jev_classifier_tool.py |
Classifies unsupported models. |
tests/agent/test_llm.py |
Tests object-detail handling. |
tests/agent/tools/internal_tools/test_jev_classifier_tool.py |
Tests Gateway unknown-model responses. |
pyproject.toml |
Bumps package and dependency versions. |
uv.lock |
Regenerates locked dependencies. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ionut-mihalache-uipath
force-pushed
the
fix/jev-gateway-errors
branch
from
October 8, 2026 07:22
867f4a6 to
44b508a
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The PR description contradicts the implemented PII-safe masking behavior, and one new test lacks required annotations.
2 open findings
1 resolved since last review
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Comment on lines
+207
to
+211
| # Only the gateway's own ProblemDetails string is first-party text. A raw | ||
| # vendor passthrough error carries an object detail relaying the vendor's | ||
| # message, which may hold customer PII: never display it. | ||
| if not isinstance(gateway_detail, str): | ||
| gateway_detail = None |
…ror details
LLM Gateway raw vendor passthrough errors carry an object detail
({"error_type", "message"}), not a ProblemDetails string. _classify passed
it through as the AgentRuntimeError detail, so UiPathErrorContract failed
validation and the run ended with a generic "unexpected error". Only the
gateway's own string detail is first-party text; an object detail relays the
vendor's message, which may carry customer PII, so it is dropped and the
mapper's own detail is used (the canned text for 400, the reason phrase
otherwise).
The Jev tool recognises the gateway's "Unsupported model used" 400 as an
unknown model, so a model the gateway does not serve surfaces as "Unknown Jev
model" (user error, with the tool's own message) instead of a generic
provider error.
Bumps uipath-langchain to 0.18.31 and the floors to uipath>=2.14.36 and
uipath-llm-client / uipath-langchain-client>=1.21.1, which drop the
unserved jev-latest default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpbvUoddLSo7W61dwpjKFC
ionut-mihalache-uipath
force-pushed
the
fix/jev-gateway-errors
branch
from
October 8, 2026 14:18
44b508a to
9b1e1d7
Compare
|
This branch has not been deployed
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.





What
agent/exceptions/llm.py:_classifyno longer crashes on object details. LLM Gateway raw vendor passthrough errors carry an objectdetail,{"error_type": ..., "message": ...}, not a ProblemDetails string._classifyused to pass that object through as theAgentRuntimeErrordetail, soUiPathErrorContractfailed validation (detail: Input should be a valid string). The run then ended with a generic "An unexpected error occurred". Now only a stringdetail(the gateway's own ProblemDetails text) is ever displayed. Any otherdetailis dropped, and the mapper's own detail is used: the canned text for 400, the HTTP reason phrase otherwise. The vendor'smessageis deliberately not shown: it is relayed provider text and may carry customer PII, the same rule the 400 branch already follows. It stays on the LLM call span.jev_classifier_tool.py: the gateway's unknown-model error is recognised. The gateway answers an unserved model with 400"Unsupported model used. The list of supported models is : ...". The tool now treats this like TypeSafe's"Unknown model: ...", so it surfaces as Unknown Jev model (LLM_PROVIDER_BAD_REQUEST, a user error). The vendor text is used only to recognise the error. The message shown is the tool's own fixed text, naming the configured model and the tool.uipath-langchainis bumped to 0.18.31. The floors rise touipath>=2.14.36(fix(agent): require the jev classifier model instead of defaulting to jev-latest uipath-python#1930) and touipath-llm-client>=1.21.1/uipath-langchain-client[...]>=1.21.1(fix: require model_name in UiPathJevClient instead of defaulting to jev-latest uipath-llm-client-python#148). Those releases drop the unservedjev-latestdefault and make the Jev model required.uv.lockis regenerated against PyPI.How it was found
I ran a low-code agent with the Jev tool on alpha through the local runtime. With the old
jev-latestdefault, the call toagenthub_/llm/raw/vendor/typesafe/model/jev-latest/completionsreturned a 400, and the error mapper crashed on its objectdetail. With this change, an unserved model (jev-9.9.9) fails cleanly:With
jev-1.13.0, the call returns 200 and the agent completes.Testing
pytest: the full suite passes against the releaseduipath2.14.36 anduipath-llm-client1.21.1 from PyPI. New tests:detailgets the canned detail.str()orrepr().ruff check,ruff format --check,scripts/lint_httpx_client.py,mypy --config-file pyproject.toml .anduv lock --checkare all clean.uv.lockalso changes markers on a few transitive packages (black,culsans,httpcore2,aiologic). That is the resolver's output for the new versions: an unmodifiedmainlocks with no changes under the same uv.🤖 Generated with Claude Code
https://claude.ai/code/session_01XpbvUoddLSo7W61dwpjKFC