Skip to content

fix(evals): never emit blank mocker error messages (SRE-640375) - #1862

Merged
mjnovice merged 3 commits into
mainfrom
fix/input-mocker-empty-error-message
Aug 14, 2026
Merged

fix(evals): never emit blank mocker error messages (SRE-640375)#1862
mjnovice merged 3 commits into
mainfrom
fix/input-mocker-empty-error-message

Conversation

@mjnovice

@mjnovice mjnovice commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

SRE-640375: a prod EvalRun.Failed alert fired with ErrorType: UiPathInputMockingError and 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 with str(e). Timeout/cancellation exceptions (asyncio.TimeoutError, CancelledError, httpx timeout classes) stringify to an empty string, so the wrapped message carries no diagnostic information into EvalRun.Failed telemetry.

Fix

  • Add format_exception_message() in _mocker.py: formats wrapped exceptions as TypeName: message, falling back to just TypeName when str(e) is empty/whitespace.
  • Apply it at both wrap sites: _input_mocker.generate_llm_input and _llm_mocker's UiPathMockResponseGenerationError.

With this change, SRE-640375 would have read Failed to generate input: TimeoutError and been immediately diagnosable. Existing non-empty messages keep their content (now prefixed with the exception type); prod alert exclusions use contains matching, so they are unaffected.

Tests

  • format_exception_message unit tests: normal message, empty-str exceptions (TimeoutError, CancelledError), whitespace-only message.
  • generate_llm_input integration test: a TimeoutError from generate_structured_output surfaces as Failed to generate input: TimeoutError.
  • pytest tests/cli/eval/mocks/ — 95 passed; ruff + mypy clean.

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 13, 2026 22:20
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Aug 13, 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.

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_input and _llm_mocker’s UiPathMockResponseGenerationError path.
  • 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__
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@mjnovice
mjnovice merged commit d0b5ac2 into main Aug 14, 2026
183 checks passed
@mjnovice
mjnovice deleted the fix/input-mocker-empty-error-message branch August 14, 2026 01:05
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.

3 participants