fix(evals): never emit blank mocker error messages (SRE-640375) - #1862
Merged
Conversation
Timeout/cancellation exceptions (asyncio.TimeoutError, CancelledError, httpx timeouts) stringify to an empty string, so the input mocker's 'Failed to generate input: ' wrap and the LLM mocker's str(e) wrap produced blank, undiagnosable ErrorMessages in EvalRun.Failed telemetry. Format wrapped exceptions as 'TypeName: message', falling back to the type name alone when the message is empty. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens eval mocker error reporting so timeout/cancellation failures don’t propagate into telemetry as blank/unactionable messages. It introduces a small shared formatter and applies it to the primary exception-wrapping sites in the eval input and LLM mockers, plus adds tests to lock in the behavior.
Changes:
- Add
format_exception_message()to ensure wrapped exceptions always include at least the exception type name. - Use the formatter when wrapping errors in
_input_mocker.generate_llm_inputand_llm_mocker’sUiPathMockResponseGenerationErrorpath. - Add unit + integration tests covering empty/whitespace exception stringification and the input-mocker wrapping message.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/uipath/tests/cli/eval/mocks/test_mock_error_messages.py | Adds tests validating non-blank wrapped exception messages (including Timeout/Cancelled cases). |
| packages/uipath/src/uipath/eval/mocks/_mocker.py | Introduces format_exception_message() helper for consistent exception message formatting. |
| packages/uipath/src/uipath/eval/mocks/_llm_mocker.py | Uses format_exception_message() when wrapping response-generation exceptions. |
| packages/uipath/src/uipath/eval/mocks/_input_mocker.py | Uses format_exception_message() when wrapping input-generation exceptions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+32
to
+33
| message = str(e).strip() | ||
| return f"{type(e).__name__}: {message}" if message else type(e).__name__ |
ajay-kesavan
approved these changes
Aug 13, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
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.



Problem
SRE-640375: a prod
EvalRun.Failedalert fired withErrorType: UiPathInputMockingErrorand the unactionable message"Failed to generate input: "— the inner error was blank.The input mocker wraps failures with
f"Failed to generate input: {str(e)}", and the LLM output mocker wraps withstr(e). Timeout/cancellation exceptions (asyncio.TimeoutError,CancelledError, httpx timeout classes) stringify to an empty string, so the wrapped message carries no diagnostic information intoEvalRun.Failedtelemetry.Fix
format_exception_message()in_mocker.py: formats wrapped exceptions asTypeName: message, falling back to justTypeNamewhenstr(e)is empty/whitespace._input_mocker.generate_llm_inputand_llm_mocker'sUiPathMockResponseGenerationError.With this change, SRE-640375 would have read
Failed to generate input: TimeoutErrorand been immediately diagnosable. Existing non-empty messages keep their content (now prefixed with the exception type); prod alert exclusions usecontainsmatching, so they are unaffected.Tests
format_exception_messageunit tests: normal message, empty-str exceptions (TimeoutError,CancelledError), whitespace-only message.generate_llm_inputintegration test: aTimeoutErrorfromgenerate_structured_outputsurfaces asFailed to generate input: TimeoutError.pytest tests/cli/eval/mocks/— 95 passed; ruff + mypy clean.🤖 Generated with Claude Code